t6 cleanup

This commit is contained in:
xensik 2022-03-21 16:36:09 +01:00
parent e1a244ff0e
commit f8d84d5237
13 changed files with 2203 additions and 2208 deletions

View File

@ -71,7 +71,6 @@ xsk::arc::t6::parser::symbol_type T6lex(xsk::arc::t6::lexer& lexer);
%token BREAK "break" %token BREAK "break"
%token CONTINUE "continue" %token CONTINUE "continue"
%token RETURN "return" %token RETURN "return"
%token BREAKPOINT "breakpoint"
%token PROFBEGIN "prof_begin" %token PROFBEGIN "prof_begin"
%token PROFEND "prof_end" %token PROFEND "prof_end"
%token THREAD "thread" %token THREAD "thread"
@ -188,7 +187,6 @@ xsk::arc::t6::parser::symbol_type T6lex(xsk::arc::t6::lexer& lexer);
%type <ast::stmt_break::ptr> stmt_break %type <ast::stmt_break::ptr> stmt_break
%type <ast::stmt_continue::ptr> stmt_continue %type <ast::stmt_continue::ptr> stmt_continue
%type <ast::stmt_return::ptr> stmt_return %type <ast::stmt_return::ptr> stmt_return
%type <ast::stmt_breakpoint::ptr> stmt_breakpoint
%type <ast::stmt_prof_begin::ptr> stmt_prof_begin %type <ast::stmt_prof_begin::ptr> stmt_prof_begin
%type <ast::stmt_prof_end::ptr> stmt_prof_end %type <ast::stmt_prof_end::ptr> stmt_prof_end
%type <ast::expr> expr %type <ast::expr> expr
@ -355,7 +353,6 @@ stmt
| stmt_break { $$.as_break = std::move($1); } | stmt_break { $$.as_break = std::move($1); }
| stmt_continue { $$.as_continue = std::move($1); } | stmt_continue { $$.as_continue = std::move($1); }
| stmt_return { $$.as_return = 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_begin { $$.as_prof_begin = std::move($1); }
| stmt_prof_end { $$.as_prof_end = std::move($1); } | stmt_prof_end { $$.as_prof_end = std::move($1); }
; ;
@ -518,11 +515,6 @@ stmt_return
{ $$ = std::make_unique<ast::stmt_return>(@$, std::make_unique<ast::node>(@$)); } { $$ = std::make_unique<ast::stmt_return>(@$, std::make_unique<ast::node>(@$)); }
; ;
stmt_breakpoint
: BREAKPOINT SEMICOLON
{ $$ = std::make_unique<ast::stmt_breakpoint>(@$); }
;
stmt_prof_begin stmt_prof_begin
: PROFBEGIN LPAREN expr_arguments RPAREN SEMICOLON : PROFBEGIN LPAREN expr_arguments RPAREN SEMICOLON
{ $$ = std::make_unique<ast::stmt_prof_begin>(@$, std::move($3)); } { $$ = std::make_unique<ast::stmt_prof_begin>(@$, std::move($3)); }
@ -839,6 +831,20 @@ expr_reference
expr_array expr_array
: expr_object LBRACKET expr RBRACKET : expr_object LBRACKET expr RBRACKET
{ $$ = std::make_unique<ast::expr_array>(@$, std::move($1), std::move($3)); } { $$ = std::make_unique<ast::expr_array>(@$, std::move($1), std::move($3)); }
| expr_getdvarvector LBRACKET expr RBRACKET
{ $$ = std::make_unique<ast::expr_array>(@$, ast::expr(std::move($1)), std::move($3)); }
| expr_vectortoangles LBRACKET expr RBRACKET
{ $$ = std::make_unique<ast::expr_array>(@$, ast::expr(std::move($1)), std::move($3)); }
| expr_angleclamp180 LBRACKET expr RBRACKET
{ $$ = std::make_unique<ast::expr_array>(@$, ast::expr(std::move($1)), std::move($3)); }
| expr_anglestoforward LBRACKET expr RBRACKET
{ $$ = std::make_unique<ast::expr_array>(@$, ast::expr(std::move($1)), std::move($3)); }
| expr_anglestoright LBRACKET expr RBRACKET
{ $$ = std::make_unique<ast::expr_array>(@$, ast::expr(std::move($1)), std::move($3)); }
| expr_anglestoup LBRACKET expr RBRACKET
{ $$ = std::make_unique<ast::expr_array>(@$, ast::expr(std::move($1)), std::move($3)); }
| expr_vectorscale LBRACKET expr RBRACKET
{ $$ = std::make_unique<ast::expr_array>(@$, ast::expr(std::move($1)), std::move($3)); }
; ;
expr_field expr_field

View File

@ -118,42 +118,6 @@ void compiler::emit_include(const ast::include::ptr& include)
} }
assembly_->includes.push_back(path); assembly_->includes.push_back(path);
/*for (const auto& inc : includes_)
{
if (inc.name == path)
{
throw comp_error(include->loc(), "error duplicated include file '" + path + "'.");
}
}
if (map_known_includes(path)) return;
try
{
auto program = parse_file(path);
std::vector<std::string> funcs;
for (const auto& decl : program->declarations)
{
if (decl == ast::kind::decl_thread)
{
funcs.push_back(decl.as_thread->name->value);
}
}
if (funcs.size() == 0)
{
throw comp_error(include->loc(), "error empty include file '" + path + "'.");
}
includes_.push_back(include_t(path, funcs));
}
catch(const std::exception& e)
{
throw comp_error(include->loc(), "error parsing include file '" + path + "': " + e.what());
}*/
} }
void compiler::emit_declaration(const ast::decl& decl) void compiler::emit_declaration(const ast::decl& decl)
@ -304,9 +268,6 @@ void compiler::emit_stmt(const ast::stmt& stmt)
case ast::kind::stmt_return: case ast::kind::stmt_return:
emit_stmt_return(stmt.as_return); emit_stmt_return(stmt.as_return);
break; break;
case ast::kind::stmt_breakpoint:
emit_stmt_breakpoint(stmt.as_breakpoint);
break;
case ast::kind::stmt_prof_begin: case ast::kind::stmt_prof_begin:
emit_stmt_prof_begin(stmt.as_prof_begin); emit_stmt_prof_begin(stmt.as_prof_begin);
break; break;
@ -699,7 +660,7 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt)
bool has_default = false; bool has_default = false;
for (auto i = 0; i < stmt->stmt->list.size(); i++) for (auto i = 0u; i < stmt->stmt->list.size(); i++)
{ {
auto& entry = stmt->stmt->list[i]; auto& entry = stmt->stmt->list[i];
@ -804,11 +765,6 @@ void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt)
emit_opcode(opcode::OP_End); emit_opcode(opcode::OP_End);
} }
void compiler::emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr&)
{
// TODO:
}
void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&) void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&)
{ {
// TODO: // TODO:
@ -1983,7 +1939,6 @@ void compiler::process_stmt(const ast::stmt& stmt)
case ast::kind::stmt_break: case ast::kind::stmt_break:
case ast::kind::stmt_continue: case ast::kind::stmt_continue:
case ast::kind::stmt_return: case ast::kind::stmt_return:
case ast::kind::stmt_breakpoint:
case ast::kind::stmt_prof_begin: case ast::kind::stmt_prof_begin:
case ast::kind::stmt_prof_end: case ast::kind::stmt_prof_end:
break; break;
@ -2138,7 +2093,7 @@ void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt)
auto num = stmt->stmt->list.size(); auto num = stmt->stmt->list.size();
for (auto i = 0; i < num; i++) for (auto i = 0u; i < num; i++)
{ {
auto& entry = stmt->stmt->list[0]; auto& entry = stmt->stmt->list[0];
@ -2179,7 +2134,7 @@ void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt)
stmt_list->list.push_back(std::move(current_case)); stmt_list->list.push_back(std::move(current_case));
} }
for (auto i = 0; i < stmt_list->list.size(); i++) for (auto i = 0u; i < stmt_list->list.size(); i++)
{ {
auto& entry = stmt_list->list[i]; auto& entry = stmt_list->list[i];
@ -2246,78 +2201,7 @@ auto compiler::variable_access(const ast::expr_identifier::ptr& name) -> std::st
throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); 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 auto compiler::is_constant_condition(const ast::expr& expr) -> bool
{ {
switch (expr.kind()) switch (expr.kind())

View File

@ -68,7 +68,6 @@ private:
void emit_stmt_break(const ast::stmt_break::ptr& stmt); void emit_stmt_break(const ast::stmt_break::ptr& stmt);
void emit_stmt_continue(const ast::stmt_continue::ptr& stmt); void emit_stmt_continue(const ast::stmt_continue::ptr& stmt);
void emit_stmt_return(const ast::stmt_return::ptr& stmt); void emit_stmt_return(const ast::stmt_return::ptr& stmt);
void emit_stmt_breakpoint(const ast::stmt_breakpoint::ptr& stmt);
void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt); void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt);
void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt); void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt);
void emit_expr(const ast::expr& expr); void emit_expr(const ast::expr& expr);
@ -150,8 +149,6 @@ private:
void process_expr_parameters(const ast::expr_parameters::ptr& expr); void process_expr_parameters(const ast::expr_parameters::ptr& expr);
void variable_register(const std::string& name); void variable_register(const std::string& name);
auto variable_access(const ast::expr_identifier::ptr& name) -> std::string; auto variable_access(const ast::expr_identifier::ptr& name) -> std::string;
//auto resolve_function_type(const ast::expr_function::ptr& expr) -> ast::call::type;
//auto resolve_reference_type(const ast::expr_reference::ptr& expr, bool& method) -> ast::call::type;
auto is_constant_condition(const ast::expr& expr) -> bool; auto is_constant_condition(const ast::expr& expr) -> bool;
auto create_label() -> std::string; auto create_label() -> std::string;
auto insert_label() -> std::string; auto insert_label() -> std::string;

View File

@ -1202,7 +1202,6 @@ void decompiler::decompile_instruction(const instruction::ptr& inst, bool last)
} }
break; break;
case opcode::OP_DevblockEnd: case opcode::OP_DevblockEnd:
case opcode::OP_Breakpoint:
default: default:
throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode));
} }
@ -1324,7 +1323,7 @@ void decompiler::decompile_infinites(const ast::stmt_list::ptr& stmt)
void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt)
{ {
for (auto i = 0; i < stmt->list.size(); i++) for (auto i = 0u; i < stmt->list.size(); i++)
{ {
auto& entry = stmt->list.at(i); auto& entry = stmt->list.at(i);
@ -1358,7 +1357,7 @@ void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt)
void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt)
{ {
for (auto i = 0; i < stmt->list.size(); i++) for (auto i = 0u; i < stmt->list.size(); i++)
{ {
if (stmt->list.at(i) == ast::kind::asm_switch) if (stmt->list.at(i) == ast::kind::asm_switch)
{ {
@ -1369,7 +1368,7 @@ void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt)
void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt)
{ {
for (auto i = 0; i < stmt->list.size(); i++) for (auto i = 0u; i < stmt->list.size(); i++)
{ {
auto& entry = stmt->list.at(i); auto& entry = stmt->list.at(i);
@ -1382,11 +1381,40 @@ void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt)
{ {
// if block is a loop check break, continue // if block is a loop check break, continue
if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue)
{
//if its a while, continue jumps back
if (stmt->list.at(j).as_node->loc().begin.line > std::stol(stmt->list.at(j).as_jump->value.substr(4), 0, 16))
{ {
decompile_if(stmt, i, j); decompile_if(stmt, i, j);
/*if (stmt->list.at(j).as_jump->loc().begin.line < std::stol(stmt->list.at(j).as_jump->value.substr(4), 0, 16)) }
// a dowhile, for or foreach, check for if/else or if/continue
else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return)
{
// block ends with a return, so jump belows to if/else
decompile_ifelse(stmt, i, j); decompile_ifelse(stmt, i, j);
else decompile_if(stmt, i, j);*/ }
else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump)
{
if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break)
{
// block ends with a break, so jump belows to if/else
decompile_ifelse(stmt, i, j);
}
else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue)
{
// block ends with a continue, so jump belows to if/else
decompile_ifelse(stmt, i, j);
}
else
{
// jump belows to if/continue
decompile_if(stmt, i, j);
}
}
else
{
decompile_if(stmt, i, j);
}
} }
else if (stmt->list.at(j).as_jump->value == blocks_.back().loc_break) else if (stmt->list.at(j).as_jump->value == blocks_.back().loc_break)
{ {
@ -1421,7 +1449,7 @@ void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt)
void decompiler::decompile_aborts(const ast::stmt_list::ptr& stmt) void decompiler::decompile_aborts(const ast::stmt_list::ptr& stmt)
{ {
for (auto i = 0; i < stmt->list.size(); i++) for (auto i = 0u; i < stmt->list.size(); i++)
{ {
if (stmt->list.at(i) == ast::kind::asm_jump) if (stmt->list.at(i) == ast::kind::asm_jump)
{ {
@ -1887,7 +1915,7 @@ void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t
auto current_case = ast::stmt(std::make_unique<ast::node>()); auto current_case = ast::stmt(std::make_unique<ast::node>());
auto num = sw_stmt->list.size(); auto num = sw_stmt->list.size();
for (auto i = 0; i < num; i++) for (auto i = 0u; i < num; i++)
{ {
auto& entry = sw_stmt->list[0]; auto& entry = sw_stmt->list[0];
@ -2567,7 +2595,7 @@ void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr)
prec = expr->rvalue.as_node->precedence(); prec = expr->rvalue.as_node->precedence();
if (prec && prec < expr->precedence() || (prec == expr->precedence() && expr->kind() == expr->rvalue.as_node->kind())) if ((prec && prec < expr->precedence()) || (prec == expr->precedence() && expr->kind() == expr->rvalue.as_node->kind()))
{ {
expr->rvalue = ast::expr(std::make_unique<ast::expr_paren>(std::move(expr->rvalue))); expr->rvalue = ast::expr(std::make_unique<ast::expr_paren>(std::move(expr->rvalue)));
} }
@ -2587,7 +2615,7 @@ void decompiler::process_expr_and(const ast::expr_and::ptr& expr)
prec = expr->rvalue.as_node->precedence(); prec = expr->rvalue.as_node->precedence();
if (prec && prec < expr->precedence() || (prec == expr->precedence() && expr->kind() == expr->rvalue.kind())) if ((prec && prec < expr->precedence()) || (prec == expr->precedence() && expr->kind() == expr->rvalue.kind()))
{ {
expr->rvalue = ast::expr(std::make_unique<ast::expr_paren>(std::move(expr->rvalue))); expr->rvalue = ast::expr(std::make_unique<ast::expr_paren>(std::move(expr->rvalue)));
} }

View File

@ -183,7 +183,7 @@ void disassembler::disassemble(const std::string& file, std::vector<std::uint8_t
exports_.push_back(entry); exports_.push_back(entry);
} }
for (auto i = 0; i < exports_.size(); i++) for (auto i = 0u; i < exports_.size(); i++)
{ {
auto& entry = exports_[i]; auto& entry = exports_[i];

View File

@ -48,7 +48,6 @@ const std::unordered_map<std::string_view, parser::token::token_kind_type> keywo
{ "break", parser::token::BREAK }, { "break", parser::token::BREAK },
{ "continue", parser::token::CONTINUE }, { "continue", parser::token::CONTINUE },
{ "return", parser::token::RETURN }, { "return", parser::token::RETURN },
{ "breakpoint", parser::token::BREAKPOINT },
{ "prof_begin", parser::token::PROFBEGIN }, { "prof_begin", parser::token::PROFBEGIN },
{ "prof_end", parser::token::PROFEND }, { "prof_end", parser::token::PROFEND },
{ "thread", parser::token::THREAD }, { "thread", parser::token::THREAD },
@ -100,8 +99,10 @@ bool buffer::push(char c)
return true; return true;
} }
reader::reader() : state(reader::end), buffer_pos(0), reader::reader() : buffer_pos(0), bytes_remaining(0), last_byte(0), current_byte(0), state(reader::end)
bytes_remaining(0), last_byte(0), current_byte(0) {} {
}
void reader::init(const char* data, size_t size) void reader::init(const char* data, size_t size)
{ {
@ -141,8 +142,8 @@ void reader::advance()
} }
} }
lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : indev_(false), clean_(true), loc_(location(&name)), lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)),
mode_(mode), header_top_(0), locs_(std::stack<location>()), readers_(std::stack<reader>()) locs_(std::stack<location>()), readers_(std::stack<reader>()), header_top_(0), mode_(mode), indev_(false), clean_(true)
{ {
reader_.init(data, size); reader_.init(data, size);
} }
@ -494,7 +495,7 @@ auto lexer::lex() -> parser::symbol_type
default: default:
if (last >= '0' && last <= '9') if (last >= '0' && last <= '9')
goto lex_number; goto lex_number;
else if (last == '_' || last >= 'A' && last <= 'Z' || last >= 'a' && last <= 'z') else if (last == '_' || (last >= 'A' && last <= 'Z') || (last >= 'a' && last <= 'z'))
goto lex_name; goto lex_name;
throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last)); throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last));
@ -597,7 +598,7 @@ lex_name:
} }
else else
{ {
for (auto i = 0; i < buffer_.length; i++) for (auto i = 0u; i < buffer_.length; i++)
{ {
auto c = buffer_.data[i]; auto c = buffer_.data[i];
@ -670,7 +671,7 @@ lex_number:
if (last == '\'') if (last == '\'')
throw comp_error(loc_, "invalid number literal"); throw comp_error(loc_, "invalid number literal");
if (dot > 1 || flt > 1 || flt && buffer_.data[buffer_.length - 1] != 'f') if (dot > 1 || flt > 1 || (flt && buffer_.data[buffer_.length - 1] != 'f'))
throw comp_error(loc_, "invalid number literal"); throw comp_error(loc_, "invalid number literal");
if (dot || flt) if (dot || flt)
@ -687,7 +688,7 @@ lex_number:
if (state == reader::end) if (state == reader::end)
break; break;
if (curr == '\'' && (last == '\'' || last == 'o') || (curr == 'o' && last == '\'')) if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\''))
throw comp_error(loc_, "invalid octal literal"); throw comp_error(loc_, "invalid octal literal");
if (curr == '\'') if (curr == '\'')
@ -721,7 +722,7 @@ lex_number:
if (state == reader::end) if (state == reader::end)
break; break;
if (curr == '\'' && (last == '\'' || last == 'b') || (curr == 'b' && last == '\'')) if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\''))
throw comp_error(loc_, "invalid binary literal"); throw comp_error(loc_, "invalid binary literal");
if (curr == '\'') if (curr == '\'')
@ -755,7 +756,7 @@ lex_number:
if (state == reader::end) if (state == reader::end)
break; break;
if (curr == '\'' && (last == '\'' || last == 'x') || (curr == 'x' && last == '\'')) if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\''))
throw comp_error(loc_, "invalid hexadecimal literal"); throw comp_error(loc_, "invalid hexadecimal literal");
if (curr == '\'') if (curr == '\'')

View File

@ -13,7 +13,7 @@ constexpr size_t max_buf_size = 0x2000;
struct buffer struct buffer
{ {
char* data; char* data;
int length; std::uint32_t length;
buffer(); buffer();
~buffer(); ~buffer();
@ -32,9 +32,14 @@ struct reader
reader(); reader();
reader& operator=(const reader& r) reader(const reader& obj)
{ {
std::memcpy(this, &r, sizeof(reader)); std::memcpy(this, &obj, sizeof(reader));
}
reader& operator=(const reader& obj)
{
std::memcpy(this, &obj, sizeof(reader));
return *this; return *this;
} }

File diff suppressed because it is too large Load Diff

View File

@ -593,79 +593,76 @@ namespace xsk { namespace arc { namespace t6 {
// stmt_break // stmt_break
char dummy58[sizeof (ast::stmt_break::ptr)]; char dummy58[sizeof (ast::stmt_break::ptr)];
// stmt_breakpoint
char dummy59[sizeof (ast::stmt_breakpoint::ptr)];
// stmt_call // stmt_call
char dummy60[sizeof (ast::stmt_call::ptr)]; char dummy59[sizeof (ast::stmt_call::ptr)];
// stmt_case // stmt_case
char dummy61[sizeof (ast::stmt_case::ptr)]; char dummy60[sizeof (ast::stmt_case::ptr)];
// stmt_continue // stmt_continue
char dummy62[sizeof (ast::stmt_continue::ptr)]; char dummy61[sizeof (ast::stmt_continue::ptr)];
// stmt_default // stmt_default
char dummy63[sizeof (ast::stmt_default::ptr)]; char dummy62[sizeof (ast::stmt_default::ptr)];
// stmt_dev // stmt_dev
char dummy64[sizeof (ast::stmt_dev::ptr)]; char dummy63[sizeof (ast::stmt_dev::ptr)];
// stmt_dowhile // stmt_dowhile
char dummy65[sizeof (ast::stmt_dowhile::ptr)]; char dummy64[sizeof (ast::stmt_dowhile::ptr)];
// stmt_endon // stmt_endon
char dummy66[sizeof (ast::stmt_endon::ptr)]; char dummy65[sizeof (ast::stmt_endon::ptr)];
// stmt_expr // stmt_expr
char dummy67[sizeof (ast::stmt_expr::ptr)]; char dummy66[sizeof (ast::stmt_expr::ptr)];
// stmt_for // stmt_for
char dummy68[sizeof (ast::stmt_for::ptr)]; char dummy67[sizeof (ast::stmt_for::ptr)];
// stmt_foreach // stmt_foreach
char dummy69[sizeof (ast::stmt_foreach::ptr)]; char dummy68[sizeof (ast::stmt_foreach::ptr)];
// stmt_if // stmt_if
char dummy70[sizeof (ast::stmt_if::ptr)]; char dummy69[sizeof (ast::stmt_if::ptr)];
// stmt_ifelse // stmt_ifelse
char dummy71[sizeof (ast::stmt_ifelse::ptr)]; char dummy70[sizeof (ast::stmt_ifelse::ptr)];
// stmt_list // stmt_list
// stmt_or_dev_list // stmt_or_dev_list
// stmt_block // stmt_block
char dummy72[sizeof (ast::stmt_list::ptr)]; char dummy71[sizeof (ast::stmt_list::ptr)];
// stmt_notify // stmt_notify
char dummy73[sizeof (ast::stmt_notify::ptr)]; char dummy72[sizeof (ast::stmt_notify::ptr)];
// stmt_prof_begin // stmt_prof_begin
char dummy74[sizeof (ast::stmt_prof_begin::ptr)]; char dummy73[sizeof (ast::stmt_prof_begin::ptr)];
// stmt_prof_end // stmt_prof_end
char dummy75[sizeof (ast::stmt_prof_end::ptr)]; char dummy74[sizeof (ast::stmt_prof_end::ptr)];
// stmt_return // stmt_return
char dummy76[sizeof (ast::stmt_return::ptr)]; char dummy75[sizeof (ast::stmt_return::ptr)];
// stmt_switch // stmt_switch
char dummy77[sizeof (ast::stmt_switch::ptr)]; char dummy76[sizeof (ast::stmt_switch::ptr)];
// stmt_wait // stmt_wait
char dummy78[sizeof (ast::stmt_wait::ptr)]; char dummy77[sizeof (ast::stmt_wait::ptr)];
// stmt_waittill // stmt_waittill
char dummy79[sizeof (ast::stmt_waittill::ptr)]; char dummy78[sizeof (ast::stmt_waittill::ptr)];
// stmt_waittillframeend // stmt_waittillframeend
char dummy80[sizeof (ast::stmt_waittillframeend::ptr)]; char dummy79[sizeof (ast::stmt_waittillframeend::ptr)];
// stmt_waittillmatch // stmt_waittillmatch
char dummy81[sizeof (ast::stmt_waittillmatch::ptr)]; char dummy80[sizeof (ast::stmt_waittillmatch::ptr)];
// stmt_while // stmt_while
char dummy82[sizeof (ast::stmt_while::ptr)]; char dummy81[sizeof (ast::stmt_while::ptr)];
// "path" // "path"
// "identifier" // "identifier"
@ -674,7 +671,7 @@ namespace xsk { namespace arc { namespace t6 {
// "hash" // "hash"
// "float" // "float"
// "integer" // "integer"
char dummy83[sizeof (std::string)]; char dummy82[sizeof (std::string)];
}; };
/// The size of the largest semantic type. /// The size of the largest semantic type.
@ -758,98 +755,97 @@ namespace xsk { namespace arc { namespace t6 {
BREAK = 32, // "break" BREAK = 32, // "break"
CONTINUE = 33, // "continue" CONTINUE = 33, // "continue"
RETURN = 34, // "return" RETURN = 34, // "return"
BREAKPOINT = 35, // "breakpoint" PROFBEGIN = 35, // "prof_begin"
PROFBEGIN = 36, // "prof_begin" PROFEND = 36, // "prof_end"
PROFEND = 37, // "prof_end" THREAD = 37, // "thread"
THREAD = 38, // "thread" TRUE = 38, // "true"
TRUE = 39, // "true" FALSE = 39, // "false"
FALSE = 40, // "false" UNDEFINED = 40, // "undefined"
UNDEFINED = 41, // "undefined" SIZE = 41, // "size"
SIZE = 42, // "size" GAME = 42, // "game"
GAME = 43, // "game" SELF = 43, // "self"
SELF = 44, // "self" ANIM = 44, // "anim"
ANIM = 45, // "anim" LEVEL = 45, // "level"
LEVEL = 46, // "level" GETNEXTARRAYKEY = 46, // "getnextarraykey"
GETNEXTARRAYKEY = 47, // "getnextarraykey" GETFIRSTARRAYKEY = 47, // "getfirstarraykey"
GETFIRSTARRAYKEY = 48, // "getfirstarraykey" GETDVARCOLORALPHA = 48, // "getdvarcoloralpha"
GETDVARCOLORALPHA = 49, // "getdvarcoloralpha" GETDVARCOLORBLUE = 49, // "getdvarcolorblue"
GETDVARCOLORBLUE = 50, // "getdvarcolorblue" GETDVARCOLORGREEN = 50, // "getdvarcolorgreen"
GETDVARCOLORGREEN = 51, // "getdvarcolorgreen" GETDVARCOLORRED = 51, // "getdvarcolorred"
GETDVARCOLORRED = 52, // "getdvarcolorred" GETDVARVECTOR = 52, // "getdvarvector"
GETDVARVECTOR = 53, // "getdvarvector" GETDVARFLOAT = 53, // "getdvarfloat"
GETDVARFLOAT = 54, // "getdvarfloat" GETDVARINT = 54, // "getdvarint"
GETDVARINT = 55, // "getdvarint" GETDVAR = 55, // "getdvar"
GETDVAR = 56, // "getdvar" GETTIME = 56, // "gettime"
GETTIME = 57, // "gettime" ABS = 57, // "abs"
ABS = 58, // "abs" VECTORTOANGLES = 58, // "vectortoangles"
VECTORTOANGLES = 59, // "vectortoangles" ANGLECLAMP180 = 59, // "angleclamp180"
ANGLECLAMP180 = 60, // "angleclamp180" ANGLESTOFORWARD = 60, // "anglestoforward"
ANGLESTOFORWARD = 61, // "anglestoforward" ANGLESTORIGHT = 61, // "anglestoright"
ANGLESTORIGHT = 62, // "anglestoright" ANGLESTOUP = 62, // "anglestoup"
ANGLESTOUP = 63, // "anglestoup" VECTORSCALE = 63, // "vectorscale"
VECTORSCALE = 64, // "vectorscale" ISDEFINED = 64, // "isdefined"
ISDEFINED = 65, // "isdefined" LPAREN = 65, // "("
LPAREN = 66, // "(" RPAREN = 66, // ")"
RPAREN = 67, // ")" LBRACE = 67, // "{"
LBRACE = 68, // "{" RBRACE = 68, // "}"
RBRACE = 69, // "}" LBRACKET = 69, // "["
LBRACKET = 70, // "[" RBRACKET = 70, // "]"
RBRACKET = 71, // "]" COMMA = 71, // ","
COMMA = 72, // "," DOT = 72, // "."
DOT = 73, // "." DOUBLECOLON = 73, // "::"
DOUBLECOLON = 74, // "::" COLON = 74, // ":"
COLON = 75, // ":" SEMICOLON = 75, // ";"
SEMICOLON = 76, // ";" QMARK = 76, // "?"
QMARK = 77, // "?" INCREMENT = 77, // "++"
INCREMENT = 78, // "++" DECREMENT = 78, // "--"
DECREMENT = 79, // "--" LSHIFT = 79, // "<<"
LSHIFT = 80, // "<<" RSHIFT = 80, // ">>"
RSHIFT = 81, // ">>" OR = 81, // "||"
OR = 82, // "||" AND = 82, // "&&"
AND = 83, // "&&" EQUALITY = 83, // "=="
EQUALITY = 84, // "==" INEQUALITY = 84, // "!="
INEQUALITY = 85, // "!=" LESS_EQUAL = 85, // "<="
LESS_EQUAL = 86, // "<=" GREATER_EQUAL = 86, // ">="
GREATER_EQUAL = 87, // ">=" LESS = 87, // "<"
LESS = 88, // "<" GREATER = 88, // ">"
GREATER = 89, // ">" NOT = 89, // "!"
NOT = 90, // "!" COMPLEMENT = 90, // "~"
COMPLEMENT = 91, // "~" ASSIGN = 91, // "="
ASSIGN = 92, // "=" ASSIGN_ADD = 92, // "+="
ASSIGN_ADD = 93, // "+=" ASSIGN_SUB = 93, // "-="
ASSIGN_SUB = 94, // "-=" ASSIGN_MUL = 94, // "*="
ASSIGN_MUL = 95, // "*=" ASSIGN_DIV = 95, // "/="
ASSIGN_DIV = 96, // "/=" ASSIGN_MOD = 96, // "%="
ASSIGN_MOD = 97, // "%=" ASSIGN_BW_OR = 97, // "|="
ASSIGN_BW_OR = 98, // "|=" ASSIGN_BW_AND = 98, // "&="
ASSIGN_BW_AND = 99, // "&=" ASSIGN_BW_EXOR = 99, // "^="
ASSIGN_BW_EXOR = 100, // "^=" ASSIGN_RSHIFT = 100, // ">>="
ASSIGN_RSHIFT = 101, // ">>=" ASSIGN_LSHIFT = 101, // "<<="
ASSIGN_LSHIFT = 102, // "<<=" BITWISE_OR = 102, // "|"
BITWISE_OR = 103, // "|" BITWISE_AND = 103, // "&"
BITWISE_AND = 104, // "&" BITWISE_EXOR = 104, // "^"
BITWISE_EXOR = 105, // "^" ADD = 105, // "+"
ADD = 106, // "+" SUB = 106, // "-"
SUB = 107, // "-" MUL = 107, // "*"
MUL = 108, // "*" DIV = 108, // "/"
DIV = 109, // "/" MOD = 109, // "%"
MOD = 110, // "%" PATH = 110, // "path"
PATH = 111, // "path" IDENTIFIER = 111, // "identifier"
IDENTIFIER = 112, // "identifier" STRING = 112, // "string literal"
STRING = 113, // "string literal" ISTRING = 113, // "localized string"
ISTRING = 114, // "localized string" HASH = 114, // "hash"
HASH = 115, // "hash" FLOAT = 115, // "float"
FLOAT = 116, // "float" INTEGER = 116, // "integer"
INTEGER = 117, // "integer" SIZEOF = 117, // SIZEOF
SIZEOF = 118, // SIZEOF THEN = 118, // THEN
THEN = 119, // THEN TERN = 119, // TERN
TERN = 120, // TERN NEG = 120, // NEG
NEG = 121, // NEG ANIMREF = 121, // ANIMREF
ANIMREF = 122, // ANIMREF PREINC = 122, // PREINC
PREINC = 123, // PREINC PREDEC = 123, // PREDEC
PREDEC = 124, // PREDEC POSTINC = 124, // POSTINC
POSTINC = 125, // POSTINC POSTDEC = 125 // POSTDEC
POSTDEC = 126 // POSTDEC
}; };
/// Backward compatibility alias (Bison 3.6). /// Backward compatibility alias (Bison 3.6).
typedef token_kind_type yytokentype; typedef token_kind_type yytokentype;
@ -866,7 +862,7 @@ namespace xsk { namespace arc { namespace t6 {
{ {
enum symbol_kind_type enum symbol_kind_type
{ {
YYNTOKENS = 127, ///< Number of tokens. YYNTOKENS = 126, ///< Number of tokens.
S_YYEMPTY = -2, S_YYEMPTY = -2,
S_YYEOF = 0, // "end of file" S_YYEOF = 0, // "end of file"
S_YYerror = 1, // error S_YYerror = 1, // error
@ -903,197 +899,195 @@ namespace xsk { namespace arc { namespace t6 {
S_BREAK = 32, // "break" S_BREAK = 32, // "break"
S_CONTINUE = 33, // "continue" S_CONTINUE = 33, // "continue"
S_RETURN = 34, // "return" S_RETURN = 34, // "return"
S_BREAKPOINT = 35, // "breakpoint" S_PROFBEGIN = 35, // "prof_begin"
S_PROFBEGIN = 36, // "prof_begin" S_PROFEND = 36, // "prof_end"
S_PROFEND = 37, // "prof_end" S_THREAD = 37, // "thread"
S_THREAD = 38, // "thread" S_TRUE = 38, // "true"
S_TRUE = 39, // "true" S_FALSE = 39, // "false"
S_FALSE = 40, // "false" S_UNDEFINED = 40, // "undefined"
S_UNDEFINED = 41, // "undefined" S_SIZE = 41, // "size"
S_SIZE = 42, // "size" S_GAME = 42, // "game"
S_GAME = 43, // "game" S_SELF = 43, // "self"
S_SELF = 44, // "self" S_ANIM = 44, // "anim"
S_ANIM = 45, // "anim" S_LEVEL = 45, // "level"
S_LEVEL = 46, // "level" S_GETNEXTARRAYKEY = 46, // "getnextarraykey"
S_GETNEXTARRAYKEY = 47, // "getnextarraykey" S_GETFIRSTARRAYKEY = 47, // "getfirstarraykey"
S_GETFIRSTARRAYKEY = 48, // "getfirstarraykey" S_GETDVARCOLORALPHA = 48, // "getdvarcoloralpha"
S_GETDVARCOLORALPHA = 49, // "getdvarcoloralpha" S_GETDVARCOLORBLUE = 49, // "getdvarcolorblue"
S_GETDVARCOLORBLUE = 50, // "getdvarcolorblue" S_GETDVARCOLORGREEN = 50, // "getdvarcolorgreen"
S_GETDVARCOLORGREEN = 51, // "getdvarcolorgreen" S_GETDVARCOLORRED = 51, // "getdvarcolorred"
S_GETDVARCOLORRED = 52, // "getdvarcolorred" S_GETDVARVECTOR = 52, // "getdvarvector"
S_GETDVARVECTOR = 53, // "getdvarvector" S_GETDVARFLOAT = 53, // "getdvarfloat"
S_GETDVARFLOAT = 54, // "getdvarfloat" S_GETDVARINT = 54, // "getdvarint"
S_GETDVARINT = 55, // "getdvarint" S_GETDVAR = 55, // "getdvar"
S_GETDVAR = 56, // "getdvar" S_GETTIME = 56, // "gettime"
S_GETTIME = 57, // "gettime" S_ABS = 57, // "abs"
S_ABS = 58, // "abs" S_VECTORTOANGLES = 58, // "vectortoangles"
S_VECTORTOANGLES = 59, // "vectortoangles" S_ANGLECLAMP180 = 59, // "angleclamp180"
S_ANGLECLAMP180 = 60, // "angleclamp180" S_ANGLESTOFORWARD = 60, // "anglestoforward"
S_ANGLESTOFORWARD = 61, // "anglestoforward" S_ANGLESTORIGHT = 61, // "anglestoright"
S_ANGLESTORIGHT = 62, // "anglestoright" S_ANGLESTOUP = 62, // "anglestoup"
S_ANGLESTOUP = 63, // "anglestoup" S_VECTORSCALE = 63, // "vectorscale"
S_VECTORSCALE = 64, // "vectorscale" S_ISDEFINED = 64, // "isdefined"
S_ISDEFINED = 65, // "isdefined" S_LPAREN = 65, // "("
S_LPAREN = 66, // "(" S_RPAREN = 66, // ")"
S_RPAREN = 67, // ")" S_LBRACE = 67, // "{"
S_LBRACE = 68, // "{" S_RBRACE = 68, // "}"
S_RBRACE = 69, // "}" S_LBRACKET = 69, // "["
S_LBRACKET = 70, // "[" S_RBRACKET = 70, // "]"
S_RBRACKET = 71, // "]" S_COMMA = 71, // ","
S_COMMA = 72, // "," S_DOT = 72, // "."
S_DOT = 73, // "." S_DOUBLECOLON = 73, // "::"
S_DOUBLECOLON = 74, // "::" S_COLON = 74, // ":"
S_COLON = 75, // ":" S_SEMICOLON = 75, // ";"
S_SEMICOLON = 76, // ";" S_QMARK = 76, // "?"
S_QMARK = 77, // "?" S_INCREMENT = 77, // "++"
S_INCREMENT = 78, // "++" S_DECREMENT = 78, // "--"
S_DECREMENT = 79, // "--" S_LSHIFT = 79, // "<<"
S_LSHIFT = 80, // "<<" S_RSHIFT = 80, // ">>"
S_RSHIFT = 81, // ">>" S_OR = 81, // "||"
S_OR = 82, // "||" S_AND = 82, // "&&"
S_AND = 83, // "&&" S_EQUALITY = 83, // "=="
S_EQUALITY = 84, // "==" S_INEQUALITY = 84, // "!="
S_INEQUALITY = 85, // "!=" S_LESS_EQUAL = 85, // "<="
S_LESS_EQUAL = 86, // "<=" S_GREATER_EQUAL = 86, // ">="
S_GREATER_EQUAL = 87, // ">=" S_LESS = 87, // "<"
S_LESS = 88, // "<" S_GREATER = 88, // ">"
S_GREATER = 89, // ">" S_NOT = 89, // "!"
S_NOT = 90, // "!" S_COMPLEMENT = 90, // "~"
S_COMPLEMENT = 91, // "~" S_ASSIGN = 91, // "="
S_ASSIGN = 92, // "=" S_ASSIGN_ADD = 92, // "+="
S_ASSIGN_ADD = 93, // "+=" S_ASSIGN_SUB = 93, // "-="
S_ASSIGN_SUB = 94, // "-=" S_ASSIGN_MUL = 94, // "*="
S_ASSIGN_MUL = 95, // "*=" S_ASSIGN_DIV = 95, // "/="
S_ASSIGN_DIV = 96, // "/=" S_ASSIGN_MOD = 96, // "%="
S_ASSIGN_MOD = 97, // "%=" S_ASSIGN_BW_OR = 97, // "|="
S_ASSIGN_BW_OR = 98, // "|=" S_ASSIGN_BW_AND = 98, // "&="
S_ASSIGN_BW_AND = 99, // "&=" S_ASSIGN_BW_EXOR = 99, // "^="
S_ASSIGN_BW_EXOR = 100, // "^=" S_ASSIGN_RSHIFT = 100, // ">>="
S_ASSIGN_RSHIFT = 101, // ">>=" S_ASSIGN_LSHIFT = 101, // "<<="
S_ASSIGN_LSHIFT = 102, // "<<=" S_BITWISE_OR = 102, // "|"
S_BITWISE_OR = 103, // "|" S_BITWISE_AND = 103, // "&"
S_BITWISE_AND = 104, // "&" S_BITWISE_EXOR = 104, // "^"
S_BITWISE_EXOR = 105, // "^" S_ADD = 105, // "+"
S_ADD = 106, // "+" S_SUB = 106, // "-"
S_SUB = 107, // "-" S_MUL = 107, // "*"
S_MUL = 108, // "*" S_DIV = 108, // "/"
S_DIV = 109, // "/" S_MOD = 109, // "%"
S_MOD = 110, // "%" S_PATH = 110, // "path"
S_PATH = 111, // "path" S_IDENTIFIER = 111, // "identifier"
S_IDENTIFIER = 112, // "identifier" S_STRING = 112, // "string literal"
S_STRING = 113, // "string literal" S_ISTRING = 113, // "localized string"
S_ISTRING = 114, // "localized string" S_HASH = 114, // "hash"
S_HASH = 115, // "hash" S_FLOAT = 115, // "float"
S_FLOAT = 116, // "float" S_INTEGER = 116, // "integer"
S_INTEGER = 117, // "integer" S_SIZEOF = 117, // SIZEOF
S_SIZEOF = 118, // SIZEOF S_THEN = 118, // THEN
S_THEN = 119, // THEN S_TERN = 119, // TERN
S_TERN = 120, // TERN S_NEG = 120, // NEG
S_NEG = 121, // NEG S_ANIMREF = 121, // ANIMREF
S_ANIMREF = 122, // ANIMREF S_PREINC = 122, // PREINC
S_PREINC = 123, // PREINC S_PREDEC = 123, // PREDEC
S_PREDEC = 124, // PREDEC S_POSTINC = 124, // POSTINC
S_POSTINC = 125, // POSTINC S_POSTDEC = 125, // POSTDEC
S_POSTDEC = 126, // POSTDEC S_YYACCEPT = 126, // $accept
S_YYACCEPT = 127, // $accept S_root = 127, // root
S_root = 128, // root S_program = 128, // program
S_program = 129, // program S_inline = 129, // inline
S_inline = 130, // inline S_include = 130, // include
S_include = 131, // include S_declaration = 131, // declaration
S_declaration = 132, // declaration S_decl_usingtree = 132, // decl_usingtree
S_decl_usingtree = 133, // decl_usingtree S_decl_constant = 133, // decl_constant
S_decl_constant = 134, // decl_constant S_decl_thread = 134, // decl_thread
S_decl_thread = 135, // decl_thread S_stmt = 135, // stmt
S_stmt = 136, // stmt S_stmt_or_dev = 136, // stmt_or_dev
S_stmt_or_dev = 137, // stmt_or_dev S_stmt_list = 137, // stmt_list
S_stmt_list = 138, // stmt_list S_stmt_or_dev_list = 138, // stmt_or_dev_list
S_stmt_or_dev_list = 139, // stmt_or_dev_list S_stmt_dev = 139, // stmt_dev
S_stmt_dev = 140, // stmt_dev S_stmt_block = 140, // stmt_block
S_stmt_block = 141, // stmt_block S_stmt_expr = 141, // stmt_expr
S_stmt_expr = 142, // stmt_expr S_stmt_call = 142, // stmt_call
S_stmt_call = 143, // stmt_call S_stmt_assign = 143, // stmt_assign
S_stmt_assign = 144, // stmt_assign S_stmt_endon = 144, // stmt_endon
S_stmt_endon = 145, // stmt_endon S_stmt_notify = 145, // stmt_notify
S_stmt_notify = 146, // stmt_notify S_stmt_wait = 146, // stmt_wait
S_stmt_wait = 147, // stmt_wait S_stmt_waittill = 147, // stmt_waittill
S_stmt_waittill = 148, // stmt_waittill S_stmt_waittillmatch = 148, // stmt_waittillmatch
S_stmt_waittillmatch = 149, // stmt_waittillmatch S_stmt_waittillframeend = 149, // stmt_waittillframeend
S_stmt_waittillframeend = 150, // stmt_waittillframeend S_stmt_if = 150, // stmt_if
S_stmt_if = 151, // stmt_if S_stmt_ifelse = 151, // stmt_ifelse
S_stmt_ifelse = 152, // stmt_ifelse S_stmt_while = 152, // stmt_while
S_stmt_while = 153, // stmt_while S_stmt_dowhile = 153, // stmt_dowhile
S_stmt_dowhile = 154, // stmt_dowhile S_stmt_for = 154, // stmt_for
S_stmt_for = 155, // stmt_for S_stmt_foreach = 155, // stmt_foreach
S_stmt_foreach = 156, // stmt_foreach S_stmt_switch = 156, // stmt_switch
S_stmt_switch = 157, // stmt_switch S_stmt_case = 157, // stmt_case
S_stmt_case = 158, // stmt_case S_stmt_default = 158, // stmt_default
S_stmt_default = 159, // stmt_default S_stmt_break = 159, // stmt_break
S_stmt_break = 160, // stmt_break S_stmt_continue = 160, // stmt_continue
S_stmt_continue = 161, // stmt_continue S_stmt_return = 161, // stmt_return
S_stmt_return = 162, // stmt_return S_stmt_prof_begin = 162, // stmt_prof_begin
S_stmt_breakpoint = 163, // stmt_breakpoint S_stmt_prof_end = 163, // stmt_prof_end
S_stmt_prof_begin = 164, // stmt_prof_begin S_expr = 164, // expr
S_stmt_prof_end = 165, // stmt_prof_end S_expr_or_empty = 165, // expr_or_empty
S_expr = 166, // expr S_expr_assign = 166, // expr_assign
S_expr_or_empty = 167, // expr_or_empty S_expr_increment = 167, // expr_increment
S_expr_assign = 168, // expr_assign S_expr_decrement = 168, // expr_decrement
S_expr_increment = 169, // expr_increment S_expr_ternary = 169, // expr_ternary
S_expr_decrement = 170, // expr_decrement S_expr_binary = 170, // expr_binary
S_expr_ternary = 171, // expr_ternary S_expr_primitive = 171, // expr_primitive
S_expr_binary = 172, // expr_binary S_expr_complement = 172, // expr_complement
S_expr_primitive = 173, // expr_primitive S_expr_not = 173, // expr_not
S_expr_complement = 174, // expr_complement S_expr_call = 174, // expr_call
S_expr_not = 175, // expr_not S_expr_method = 175, // expr_method
S_expr_call = 176, // expr_call S_expr_function = 176, // expr_function
S_expr_method = 177, // expr_method S_expr_pointer = 177, // expr_pointer
S_expr_function = 178, // expr_function S_expr_parameters = 178, // expr_parameters
S_expr_pointer = 179, // expr_pointer S_expr_arguments = 179, // expr_arguments
S_expr_parameters = 180, // expr_parameters S_expr_arguments_no_empty = 180, // expr_arguments_no_empty
S_expr_arguments = 181, // expr_arguments S_expr_getnextarraykey = 181, // expr_getnextarraykey
S_expr_arguments_no_empty = 182, // expr_arguments_no_empty S_expr_getfirstarraykey = 182, // expr_getfirstarraykey
S_expr_getnextarraykey = 183, // expr_getnextarraykey S_expr_getdvarcoloralpha = 183, // expr_getdvarcoloralpha
S_expr_getfirstarraykey = 184, // expr_getfirstarraykey S_expr_getdvarcolorblue = 184, // expr_getdvarcolorblue
S_expr_getdvarcoloralpha = 185, // expr_getdvarcoloralpha S_expr_getdvarcolorgreen = 185, // expr_getdvarcolorgreen
S_expr_getdvarcolorblue = 186, // expr_getdvarcolorblue S_expr_getdvarcolorred = 186, // expr_getdvarcolorred
S_expr_getdvarcolorgreen = 187, // expr_getdvarcolorgreen S_expr_getdvarvector = 187, // expr_getdvarvector
S_expr_getdvarcolorred = 188, // expr_getdvarcolorred S_expr_getdvarfloat = 188, // expr_getdvarfloat
S_expr_getdvarvector = 189, // expr_getdvarvector S_expr_getdvarint = 189, // expr_getdvarint
S_expr_getdvarfloat = 190, // expr_getdvarfloat S_expr_getdvar = 190, // expr_getdvar
S_expr_getdvarint = 191, // expr_getdvarint S_expr_gettime = 191, // expr_gettime
S_expr_getdvar = 192, // expr_getdvar S_expr_abs = 192, // expr_abs
S_expr_gettime = 193, // expr_gettime S_expr_vectortoangles = 193, // expr_vectortoangles
S_expr_abs = 194, // expr_abs S_expr_angleclamp180 = 194, // expr_angleclamp180
S_expr_vectortoangles = 195, // expr_vectortoangles S_expr_anglestoforward = 195, // expr_anglestoforward
S_expr_angleclamp180 = 196, // expr_angleclamp180 S_expr_anglestoright = 196, // expr_anglestoright
S_expr_anglestoforward = 197, // expr_anglestoforward S_expr_anglestoup = 197, // expr_anglestoup
S_expr_anglestoright = 198, // expr_anglestoright S_expr_vectorscale = 198, // expr_vectorscale
S_expr_anglestoup = 199, // expr_anglestoup S_expr_isdefined = 199, // expr_isdefined
S_expr_vectorscale = 200, // expr_vectorscale S_expr_reference = 200, // expr_reference
S_expr_isdefined = 201, // expr_isdefined S_expr_array = 201, // expr_array
S_expr_reference = 202, // expr_reference S_expr_field = 202, // expr_field
S_expr_array = 203, // expr_array S_expr_size = 203, // expr_size
S_expr_field = 204, // expr_field S_expr_paren = 204, // expr_paren
S_expr_size = 205, // expr_size S_expr_object = 205, // expr_object
S_expr_paren = 206, // expr_paren S_expr_empty_array = 206, // expr_empty_array
S_expr_object = 207, // expr_object S_expr_undefined = 207, // expr_undefined
S_expr_empty_array = 208, // expr_empty_array S_expr_game = 208, // expr_game
S_expr_undefined = 209, // expr_undefined S_expr_self = 209, // expr_self
S_expr_game = 210, // expr_game S_expr_anim = 210, // expr_anim
S_expr_self = 211, // expr_self S_expr_level = 211, // expr_level
S_expr_anim = 212, // expr_anim S_expr_animation = 212, // expr_animation
S_expr_level = 213, // expr_level S_expr_identifier_nosize = 213, // expr_identifier_nosize
S_expr_animation = 214, // expr_animation S_expr_identifier = 214, // expr_identifier
S_expr_identifier_nosize = 215, // expr_identifier_nosize S_expr_path = 215, // expr_path
S_expr_identifier = 216, // expr_identifier S_expr_istring = 216, // expr_istring
S_expr_path = 217, // expr_path S_expr_string = 217, // expr_string
S_expr_istring = 218, // expr_istring S_expr_vector = 218, // expr_vector
S_expr_string = 219, // expr_string S_expr_hash = 219, // expr_hash
S_expr_vector = 220, // expr_vector S_expr_float = 220, // expr_float
S_expr_hash = 221, // expr_hash S_expr_integer = 221, // expr_integer
S_expr_float = 222, // expr_float S_expr_false = 222, // expr_false
S_expr_integer = 223, // expr_integer S_expr_true = 223 // expr_true
S_expr_false = 224, // expr_false
S_expr_true = 225 // expr_true
}; };
}; };
@ -1374,10 +1368,6 @@ namespace xsk { namespace arc { namespace t6 {
value.move< ast::stmt_break::ptr > (std::move (that.value)); value.move< ast::stmt_break::ptr > (std::move (that.value));
break; 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 case symbol_kind::S_stmt_call: // stmt_call
value.move< ast::stmt_call::ptr > (std::move (that.value)); value.move< ast::stmt_call::ptr > (std::move (that.value));
break; break;
@ -2317,20 +2307,6 @@ namespace xsk { namespace arc { namespace t6 {
{} {}
#endif #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 #if 201103L <= YY_CPLUSPLUS
basic_symbol (typename Base::kind_type t, ast::stmt_call::ptr&& v, location_type&& l) basic_symbol (typename Base::kind_type t, ast::stmt_call::ptr&& v, location_type&& l)
: Base (t) : Base (t)
@ -2933,10 +2909,6 @@ switch (yykind)
value.template destroy< ast::stmt_break::ptr > (); value.template destroy< ast::stmt_break::ptr > ();
break; 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 case symbol_kind::S_stmt_call: // stmt_call
value.template destroy< ast::stmt_call::ptr > (); value.template destroy< ast::stmt_call::ptr > ();
break; break;
@ -3722,21 +3694,6 @@ switch (yykind)
return symbol_type (token::RETURN, l); return symbol_type (token::RETURN, l);
} }
#endif #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 #if 201103L <= YY_CPLUSPLUS
static static
symbol_type symbol_type
@ -5446,8 +5403,8 @@ switch (yykind)
/// Constants. /// Constants.
enum enum
{ {
yylast_ = 2863, ///< Last index in yytable_. yylast_ = 3411, ///< Last index in yytable_.
yynnts_ = 99, ///< Number of nonterminal symbols. yynnts_ = 98, ///< Number of nonterminal symbols.
yyfinal_ = 22 ///< Termination state number. yyfinal_ = 22 ///< Termination state number.
}; };
@ -5718,10 +5675,6 @@ switch (yykind)
value.copy< ast::stmt_break::ptr > (YY_MOVE (that.value)); value.copy< ast::stmt_break::ptr > (YY_MOVE (that.value));
break; 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 case symbol_kind::S_stmt_call: // stmt_call
value.copy< ast::stmt_call::ptr > (YY_MOVE (that.value)); value.copy< ast::stmt_call::ptr > (YY_MOVE (that.value));
break; break;
@ -6099,10 +6052,6 @@ switch (yykind)
value.move< ast::stmt_break::ptr > (YY_MOVE (s.value)); value.move< ast::stmt_break::ptr > (YY_MOVE (s.value));
break; 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 case symbol_kind::S_stmt_call: // stmt_call
value.move< ast::stmt_call::ptr > (YY_MOVE (s.value)); value.move< ast::stmt_call::ptr > (YY_MOVE (s.value));
break; break;
@ -6270,7 +6219,7 @@ switch (yykind)
#line 13 "parser.ypp" #line 13 "parser.ypp"
} } } // xsk::arc::t6 } } } // xsk::arc::t6
#line 6274 "parser.hpp" #line 6223 "parser.hpp"

View File

@ -161,132 +161,131 @@ auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesy
const std::array<std::pair<std::uint8_t, const char*>, 126> opcode_list const std::array<std::pair<std::uint8_t, const char*>, 126> opcode_list
{{ {{
{ std::uint8_t(opcode::OP_End),"END" }, { 0x00, "OP_End" },
{ std::uint8_t(opcode::OP_Return),"RETN" }, { 0x01, "OP_Return" },
{ std::uint8_t(opcode::OP_GetUndefined),"GET_UNDEFINED" }, { 0x02, "OP_GetUndefined" },
{ std::uint8_t(opcode::OP_GetZero),"GET_ZERO" }, { 0x03, "OP_GetZero" },
{ std::uint8_t(opcode::OP_GetByte),"GET_BYTE" }, { 0x04, "OP_GetByte" },
{ std::uint8_t(opcode::OP_GetNegByte),"GET_NBYTE" }, { 0x05, "OP_GetNegByte" },
{ std::uint8_t(opcode::OP_GetUnsignedShort),"GET_USHORT" }, { 0x06, "OP_GetUnsignedShort" },
{ std::uint8_t(opcode::OP_GetNegUnsignedShort),"GET_NUSHORT" }, { 0x07, "OP_GetNegUnsignedShort" },
{ std::uint8_t(opcode::OP_GetInteger),"GET_INT" }, { 0x08, "OP_GetInteger" },
{ std::uint8_t(opcode::OP_GetFloat),"GET_FLOAT" }, { 0x09, "OP_GetFloat" },
{ std::uint8_t(opcode::OP_GetString),"GET_STRING" }, { 0x0A, "OP_GetString" },
{ std::uint8_t(opcode::OP_GetIString),"GET_ISTRING" }, { 0x0B, "OP_GetIString" },
{ std::uint8_t(opcode::OP_GetVector),"GET_VECTOR" }, { 0x0C, "OP_GetVector" },
{ std::uint8_t(opcode::OP_GetLevelObject),"GET_LEVEL_OBJ" }, { 0x0D, "OP_GetLevelObject" },
{ std::uint8_t(opcode::OP_GetAnimObject),"GET_ANIM_OBJ" }, { 0x0E, "OP_GetAnimObject" },
{ std::uint8_t(opcode::OP_GetSelf),"GET_SELF" }, { 0x0F, "OP_GetSelf" },
{ std::uint8_t(opcode::OP_GetLevel),"GET_LEVEL" }, { 0x10, "OP_GetLevel" },
{ std::uint8_t(opcode::OP_GetGame),"GET_GAME" }, { 0x11, "OP_GetGame" },
{ std::uint8_t(opcode::OP_GetAnim),"GET_ANIM" }, { 0x12, "OP_GetAnim" },
{ std::uint8_t(opcode::OP_GetAnimation),"GET_ANIMATION" }, { 0x13, "OP_GetAnimation" },
{ std::uint8_t(opcode::OP_GetGameRef),"GET_GAME_REF" }, { 0x14, "OP_GetGameRef" },
{ std::uint8_t(opcode::OP_GetFunction),"GET_FUNCTION" }, { 0x15, "OP_GetFunction" },
{ std::uint8_t(opcode::OP_CreateLocalVariable),"CREATE_LOCAL_VARIABLE" }, { 0x16, "OP_CreateLocalVariable" },
{ std::uint8_t(opcode::OP_SafeCreateLocalVariables),"SAFE_CREATE_LOCAL_VARIABLES" }, { 0x17, "OP_SafeCreateLocalVariables" },
{ std::uint8_t(opcode::OP_RemoveLocalVariables),"REMOVE_LOCAL_VARIABLES" }, { 0x18, "OP_RemoveLocalVariables" },
{ std::uint8_t(opcode::OP_EvalLocalVariableCached),"EVAL_LOCAL_VARIABLE_CACHED" }, { 0x19, "OP_EvalLocalVariableCached" },
{ std::uint8_t(opcode::OP_EvalArray),"EVAL_ARRAY" }, { 0x1A, "OP_EvalArray" },
{ std::uint8_t(opcode::OP_EvalLocalArrayRefCached),"EVAL_LOCAL_ARRAY_REF_CACHED" }, { 0x1B, "OP_EvalLocalArrayRefCached" },
{ std::uint8_t(opcode::OP_EvalArrayRef),"EVAL_ARRAY_REF" }, { 0x1C, "OP_EvalArrayRef" },
{ std::uint8_t(opcode::OP_ClearArray),"CLEAR_ARRAY" }, { 0x1D, "OP_ClearArray" },
{ std::uint8_t(opcode::OP_EmptyArray),"EMPTY_ARRAY" }, { 0x1E, "OP_EmptyArray" },
{ std::uint8_t(opcode::OP_GetSelfObject),"GET_SELF_OBJECT" }, { 0x1F, "OP_GetSelfObject" },
{ std::uint8_t(opcode::OP_EvalFieldVariable),"EVAL_FIELD_VARIABLE" }, { 0x20, "OP_EvalFieldVariable" },
{ std::uint8_t(opcode::OP_EvalFieldVariableRef),"EVAL_FIELD_VARIABLE_REF" }, { 0x21, "OP_EvalFieldVariableRef" },
{ std::uint8_t(opcode::OP_ClearFieldVariable),"CLEAR_FIELD_VARIABLE" }, { 0x22, "OP_ClearFieldVariable" },
{ std::uint8_t(opcode::OP_SafeSetVariableFieldCached),"SAFE_SET_VARIABLE_FIELD_CACHED" }, { 0x23, "OP_SafeSetVariableFieldCached" },
{ std::uint8_t(opcode::OP_SafeSetWaittillVariableFieldCached),"SAFE_SET_WAITTILL_VARIABLE_FIELD_CACHED" }, { 0x24, "OP_SafeSetWaittillVariableFieldCached" },
{ std::uint8_t(opcode::OP_ClearParams),"CLEAR_PARAMS" }, { 0x25, "OP_ClearParams" },
{ std::uint8_t(opcode::OP_CheckClearParams),"CHECK_CLEAR_PARAMS" }, { 0x26, "OP_CheckClearParams" },
{ std::uint8_t(opcode::OP_EvalLocalVariableRefCached),"EVAL_LOCAL_VARIABLE_REF_CACHED" }, { 0x27, "OP_EvalLocalVariableRefCached" },
{ std::uint8_t(opcode::OP_SetVariableField),"SET_VARIABLE_FIELD" }, { 0x28, "OP_SetVariableField" },
{ std::uint8_t(opcode::OP_CallBuiltin),"CALL_BUILTIN_FUNC" }, { 0x29, "OP_CallBuiltin" },
{ std::uint8_t(opcode::OP_CallBuiltinMethod),"CALL_BUILTIN_METHOD" }, { 0x2A, "OP_CallBuiltinMethod" },
{ std::uint8_t(opcode::OP_Wait),"WAIT" }, { 0x2B, "OP_Wait" },
{ std::uint8_t(opcode::OP_WaitTillFrameEnd),"WAITTILLFRAMEEND" }, { 0x2C, "OP_WaitTillFrameEnd" },
{ std::uint8_t(opcode::OP_PreScriptCall),"PRE_CALL" }, { 0x2D, "OP_PreScriptCall" },
{ std::uint8_t(opcode::OP_ScriptFunctionCall),"SCRIPT_FUNC_CALL" }, { 0x2E, "OP_ScriptFunctionCall" },
{ std::uint8_t(opcode::OP_ScriptFunctionCallPointer),"SCRIPT_FUNC_CALL_POINTER" }, { 0x2F, "OP_ScriptFunctionCallPointer" },
{ std::uint8_t(opcode::OP_ScriptMethodCall),"SCRIPT_METHOD_CALL" }, { 0x30, "OP_ScriptMethodCall" },
{ std::uint8_t(opcode::OP_ScriptMethodCallPointer),"SCRIPT_METHOD_CALL_POINTER" }, { 0x31, "OP_ScriptMethodCallPointer" },
{ std::uint8_t(opcode::OP_ScriptThreadCall),"SCRIPT_THREAD_CALL" }, { 0x32, "OP_ScriptThreadCall" },
{ std::uint8_t(opcode::OP_ScriptThreadCallPointer),"SCRIPT_THREAD_CALL_POINTER" }, { 0x33, "OP_ScriptThreadCallPointer" },
{ std::uint8_t(opcode::OP_ScriptMethodThreadCall),"SCRIPT_METHOD_THREAD_CALL" }, { 0x34, "OP_ScriptMethodThreadCall" },
{ std::uint8_t(opcode::OP_ScriptMethodThreadCallPointer),"SCRIPT_METHOD_THREAD_CALL_POINTER" }, { 0x35, "OP_ScriptMethodThreadCallPointer" },
{ std::uint8_t(opcode::OP_DecTop),"DEC_TOP" }, { 0x36, "OP_DecTop" },
{ std::uint8_t(opcode::OP_CastFieldObject),"CAST_FIELD_OBJECT" }, { 0x37, "OP_CastFieldObject" },
{ std::uint8_t(opcode::OP_CastBool),"CAST_BOOL" }, { 0x38, "OP_CastBool" },
{ std::uint8_t(opcode::OP_BoolNot),"BOOL_NOT" }, { 0x39, "OP_BoolNot" },
{ std::uint8_t(opcode::OP_BoolComplement),"BOOL_COMPLEMENT" }, { 0x3A, "OP_BoolComplement" },
{ std::uint8_t(opcode::OP_JumpOnFalse),"JMP_FALSE" }, { 0x3B, "OP_JumpOnFalse" },
{ std::uint8_t(opcode::OP_JumpOnTrue),"JMP_TRUE" }, { 0x3C, "OP_JumpOnTrue" },
{ std::uint8_t(opcode::OP_JumpOnFalseExpr),"JMP_EXPR_FALSE" }, { 0x3D, "OP_JumpOnFalseExpr" },
{ std::uint8_t(opcode::OP_JumpOnTrueExpr),"JMP_EXPR_TRUE" }, { 0x3E, "OP_JumpOnTrueExpr" },
{ std::uint8_t(opcode::OP_Jump),"JMP" }, { 0x3F, "OP_Jump" },
{ std::uint8_t(opcode::OP_JumpBack),"JMP_BACK" }, { 0x40, "OP_JumpBack" },
{ std::uint8_t(opcode::OP_Inc),"INC" }, { 0x41, "OP_Inc" },
{ std::uint8_t(opcode::OP_Dec),"DEC" }, { 0x42, "OP_Dec" },
{ std::uint8_t(opcode::OP_Bit_Or),"BIT_OR" }, { 0x43, "OP_Bit_Or" },
{ std::uint8_t(opcode::OP_Bit_Xor),"BIT_XOR" }, { 0x44, "OP_Bit_Xor" },
{ std::uint8_t(opcode::OP_Bit_And),"BIT_AND" }, { 0x45, "OP_Bit_And" },
{ std::uint8_t(opcode::OP_Equal),"EQUAL" }, { 0x46, "OP_Equal" },
{ std::uint8_t(opcode::OP_NotEqual),"NOT_EQUAL" }, { 0x47, "OP_NotEqual" },
{ std::uint8_t(opcode::OP_LessThan),"LESS" }, { 0x48, "OP_LessThan" },
{ std::uint8_t(opcode::OP_GreaterThan),"GREATER" }, { 0x49, "OP_GreaterThan" },
{ std::uint8_t(opcode::OP_LessThanOrEqualTo),"LESS_EQUAL" }, { 0x4A, "OP_LessThanOrEqualTo" },
{ std::uint8_t(opcode::OP_GreaterThanOrEqualTo),"GREATER_EQUAL" }, { 0x4B, "OP_GreaterThanOrEqualTo" },
{ std::uint8_t(opcode::OP_ShiftLeft),"SHIFT_LEFT" }, { 0x4C, "OP_ShiftLeft" },
{ std::uint8_t(opcode::OP_ShiftRight),"SHIFT_RIGHT" }, { 0x4D, "OP_ShiftRight" },
{ std::uint8_t(opcode::OP_Plus),"PLUS" }, { 0x4E, "OP_Plus" },
{ std::uint8_t(opcode::OP_Minus),"MINUS" }, { 0x4F, "OP_Minus" },
{ std::uint8_t(opcode::OP_Multiply),"MULT" }, { 0x50, "OP_Multiply" },
{ std::uint8_t(opcode::OP_Divide),"DIV" }, { 0x51, "OP_Divide" },
{ std::uint8_t(opcode::OP_Modulus),"MOD" }, { 0x52, "OP_Modulus" },
{ std::uint8_t(opcode::OP_SizeOf),"SIZE" }, { 0x53, "OP_SizeOf" },
{ std::uint8_t(opcode::OP_WaitTillMatch),"WAITTILLMATCH" }, { 0x54, "OP_WaitTillMatch" },
{ std::uint8_t(opcode::OP_WaitTill),"WAITTILL" }, { 0x55, "OP_WaitTill" },
{ std::uint8_t(opcode::OP_Notify),"NOTIFY" }, { 0x56, "OP_Notify" },
{ std::uint8_t(opcode::OP_EndOn),"ENDON" }, { 0x57, "OP_EndOn" },
{ std::uint8_t(opcode::OP_VoidCodePos),"VOIDCODEPOS" }, { 0x58, "OP_VoidCodePos" },
{ std::uint8_t(opcode::OP_Switch),"SWITCH" }, { 0x59, "OP_Switch" },
{ std::uint8_t(opcode::OP_EndSwitch),"ENDSWITCH" }, { 0x5A, "OP_EndSwitch" },
{ std::uint8_t(opcode::OP_Vector),"VECTOR" }, { 0x5B, "OP_Vector" },
{ std::uint8_t(opcode::OP_GetHash),"GET_HASH" }, { 0x5C, "OP_GetHash" },
{ std::uint8_t(opcode::OP_RealWait),"REAL_WAIT" }, { 0x5D, "OP_RealWait" },
{ std::uint8_t(opcode::OP_VectorConstant),"VECTOR_CONSTANT" }, { 0x5E, "OP_VectorConstant" },
{ std::uint8_t(opcode::OP_IsDefined),"IS_DEFINED" }, { 0x5F, "OP_IsDefined" },
{ std::uint8_t(opcode::OP_VectorScale),"VECTOR_SCALE" }, { 0x60, "OP_VectorScale" },
{ std::uint8_t(opcode::OP_AnglesToUp),"ANGLES_TO_UP" }, { 0x61, "OP_AnglesToUp" },
{ std::uint8_t(opcode::OP_AnglesToRight),"ANGLES_TO_RIGHT" }, { 0x62, "OP_AnglesToRight" },
{ std::uint8_t(opcode::OP_AnglesToForward),"ANGLES_TO_FORDWARD" }, { 0x63, "OP_AnglesToForward" },
{ std::uint8_t(opcode::OP_AngleClamp180),"ANGLE_CLAMP_180" }, { 0x64, "OP_AngleClamp180" },
{ std::uint8_t(opcode::OP_VectorToAngles),"VECTOR_TO_ANGLES" }, { 0x65, "OP_VectorToAngles" },
{ std::uint8_t(opcode::OP_Abs),"ABS" }, { 0x66, "OP_Abs" },
{ std::uint8_t(opcode::OP_GetTime),"GET_TIME" }, { 0x67, "OP_GetTime" },
{ std::uint8_t(opcode::OP_GetDvar),"GET_DVAR" }, { 0x68, "OP_GetDvar" },
{ std::uint8_t(opcode::OP_GetDvarInt),"GET_DVAR_INT" }, { 0x69, "OP_GetDvarInt" },
{ std::uint8_t(opcode::OP_GetDvarFloat),"GET_DVAR_FLOAT" }, { 0x6A, "OP_GetDvarFloat" },
{ std::uint8_t(opcode::OP_GetDvarVector),"GET_DVAR_VECTOR" }, { 0x6B, "OP_GetDvarVector" },
{ std::uint8_t(opcode::OP_GetDvarColorRed),"GET_DVAR_COLOR_RED" }, { 0x6C, "OP_GetDvarColorRed" },
{ std::uint8_t(opcode::OP_GetDvarColorGreen),"GET_DVAR_COLOR_GREEN" }, { 0x6D, "OP_GetDvarColorGreen" },
{ std::uint8_t(opcode::OP_GetDvarColorBlue),"GET_DVAR_COLOR_BLUE" }, { 0x6E, "OP_GetDvarColorBlue" },
{ std::uint8_t(opcode::OP_GetDvarColorAlpha),"GET_DVAR_COLOR_ALPHA" }, { 0x6F, "OP_GetDvarColorAlpha" },
{ std::uint8_t(opcode::OP_FirstArrayKey),"FIRST_ARRAY_KEY" }, { 0x70, "OP_FirstArrayKey" },
{ std::uint8_t(opcode::OP_NextArrayKey),"NEXT_ARRAY_KEY" }, { 0x71, "OP_NextArrayKey" },
{ std::uint8_t(opcode::OP_ProfileStart),"PROFILE_START" }, { 0x72, "OP_ProfileStart" },
{ std::uint8_t(opcode::OP_ProfileStop),"PROFILE_STOP" }, { 0x73, "OP_ProfileStop" },
{ std::uint8_t(opcode::OP_SafeDecTop),"SAFE_DEC_TOP" }, { 0x74, "OP_SafeDecTop" },
{ std::uint8_t(opcode::OP_Nop),"NOP" }, { 0x75, "OP_Nop" },
{ std::uint8_t(opcode::OP_Abort),"ABORT" }, { 0x76, "OP_Abort" },
{ std::uint8_t(opcode::OP_Object),"OBJECT" }, { 0x77, "OP_Object" },
{ std::uint8_t(opcode::OP_ThreadObject),"THREAD_OBJECT" }, { 0x78, "OP_ThreadObject" },
{ std::uint8_t(opcode::OP_EvalLocalVariable),"EVAL_LOCAL_VARIABLE" }, { 0x79, "OP_EvalLocalVariable" },
{ std::uint8_t(opcode::OP_EvalLocalVariableRef),"EVAL_LOCAL_VARIABLE_REF" }, { 0x7A, "OP_EvalLocalVariableRef" },
{ std::uint8_t(opcode::OP_DevblockBegin),"DEVBLOCK_BEGIN" }, { 0x7B, "OP_DevblockBegin" },
{ std::uint8_t(opcode::OP_DevblockEnd),"DEVBLOCK_END" }, { 0x7C, "OP_DevblockEnd" },
{ std::uint8_t(opcode::OP_Breakpoint),"BREAKPOINT" },
}}; }};
const std::array<std::pair<std::uint32_t, const char*>, 3318> dvar_list const std::array<std::pair<std::uint32_t, const char*>, 3318> dvar_list

View File

@ -95,7 +95,6 @@ auto opcode_size(std::uint8_t id) -> std::uint32_t
case opcode::OP_ThreadObject: case opcode::OP_ThreadObject:
case opcode::OP_EvalLocalVariable: case opcode::OP_EvalLocalVariable:
case opcode::OP_EvalLocalVariableRef: case opcode::OP_EvalLocalVariableRef:
case opcode::OP_Breakpoint:
return 1; return 1;
case opcode::OP_GetByte: case opcode::OP_GetByte:
case opcode::OP_GetNegByte: case opcode::OP_GetNegByte:

View File

@ -146,8 +146,7 @@ enum class opcode : std::uint8_t
OP_EvalLocalVariableRef = 0x7A, OP_EvalLocalVariableRef = 0x7A,
OP_DevblockBegin = 0x7B, OP_DevblockBegin = 0x7B,
OP_DevblockEnd = 0x7C, OP_DevblockEnd = 0x7C,
OP_Breakpoint = 0x7D, OP_Count = 0x7D,
OP_Count = 0x7E,
}; };
auto opcode_size(std::uint8_t id) -> std::uint32_t; auto opcode_size(std::uint8_t id) -> std::uint32_t;

View File

@ -18,9 +18,8 @@ struct block
abort_t abort; abort_t abort;
bool is_dev; bool is_dev;
block() : is_dev(false), abort(abort_t::abort_none) {} block() : abort(abort_t::abort_none), is_dev(false) {}
block(const std::string& lbreak, const std::string& lcont) block(const std::string& lbreak, const std::string& lcont) : loc_break(lbreak), loc_continue(lcont), abort(abort_t::abort_none), is_dev(false) {}
: is_dev(false), abort(abort_t::abort_none), loc_break(lbreak), loc_continue(lcont) {}
}; };
} // namespace xsk::arc } // namespace xsk::arc