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 CONTINUE "continue"
%token RETURN "return"
%token BREAKPOINT "breakpoint"
%token PROFBEGIN "prof_begin"
%token PROFEND "prof_end"
%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_continue::ptr> stmt_continue
%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_end::ptr> stmt_prof_end
%type <ast::expr> expr
@ -355,7 +353,6 @@ stmt
| 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); }
;
@ -518,11 +515,6 @@ stmt_return
{ $$ = std::make_unique<ast::stmt_return>(@$, std::make_unique<ast::node>(@$)); }
;
stmt_breakpoint
: BREAKPOINT SEMICOLON
{ $$ = std::make_unique<ast::stmt_breakpoint>(@$); }
;
stmt_prof_begin
: PROFBEGIN LPAREN expr_arguments RPAREN SEMICOLON
{ $$ = std::make_unique<ast::stmt_prof_begin>(@$, std::move($3)); }
@ -839,6 +831,20 @@ expr_reference
expr_array
: expr_object LBRACKET expr RBRACKET
{ $$ = 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

View File

@ -118,42 +118,6 @@ void compiler::emit_include(const ast::include::ptr& include)
}
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)
@ -304,9 +268,6 @@ void compiler::emit_stmt(const ast::stmt& stmt)
case ast::kind::stmt_return:
emit_stmt_return(stmt.as_return);
break;
case ast::kind::stmt_breakpoint:
emit_stmt_breakpoint(stmt.as_breakpoint);
break;
case ast::kind::stmt_prof_begin:
emit_stmt_prof_begin(stmt.as_prof_begin);
break;
@ -699,7 +660,7 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt)
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];
@ -804,11 +765,6 @@ void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt)
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&)
{
// TODO:
@ -1983,7 +1939,6 @@ void compiler::process_stmt(const ast::stmt& stmt)
case ast::kind::stmt_break:
case ast::kind::stmt_continue:
case ast::kind::stmt_return:
case ast::kind::stmt_breakpoint:
case ast::kind::stmt_prof_begin:
case ast::kind::stmt_prof_end:
break;
@ -2138,7 +2093,7 @@ void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt)
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];
@ -2179,7 +2134,7 @@ void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt)
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];
@ -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.");
}
/*
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())

View File

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

View File

@ -1202,7 +1202,6 @@ void decompiler::decompile_instruction(const instruction::ptr& inst, bool last)
}
break;
case opcode::OP_DevblockEnd:
case opcode::OP_Breakpoint:
default:
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)
{
for (auto i = 0; i < stmt->list.size(); i++)
for (auto i = 0u; i < stmt->list.size(); 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)
{
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)
{
@ -1369,7 +1368,7 @@ void decompiler::decompile_switches(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);
@ -1383,10 +1382,39 @@ void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt)
// if block is a loop check break, continue
if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue)
{
decompile_if(stmt, i, j);
/*if (stmt->list.at(j).as_jump->loc().begin.line < std::stol(stmt->list.at(j).as_jump->value.substr(4), 0, 16))
//if its a while, continue jumps back
if (stmt->list.at(j).as_node->loc().begin.line > std::stol(stmt->list.at(j).as_jump->value.substr(4), 0, 16))
{
decompile_if(stmt, i, j);
}
// a dowhile, for or foreach, check for if/else or if/continue
else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return)
{
// block ends with a return, so jump belows to if/else
decompile_ifelse(stmt, i, j);
else 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)
{
@ -1421,7 +1449,7 @@ void decompiler::decompile_ifelses(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)
{
@ -1640,7 +1668,7 @@ void decompiler::decompile_loop(const ast::stmt_list::ptr& stmt, std::uint32_t s
auto ref1 = stmt->list.at(end).loc().label();
auto ref2 = stmt->list.at(start).loc().label();
if (find_location_reference(stmt, start, end, ref1))
{
// jump is referenced, not post-expr
@ -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 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];
@ -2567,7 +2595,7 @@ void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr)
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)));
}
@ -2587,7 +2615,7 @@ void decompiler::process_expr_and(const ast::expr_and::ptr& expr)
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)));
}

View File

@ -183,7 +183,7 @@ void disassembler::disassemble(const std::string& file, std::vector<std::uint8_t
exports_.push_back(entry);
}
for (auto i = 0; i < exports_.size(); i++)
for (auto i = 0u; i < exports_.size(); 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 },
{ "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 },
@ -100,8 +99,10 @@ bool buffer::push(char c)
return true;
}
reader::reader() : state(reader::end), buffer_pos(0),
bytes_remaining(0), last_byte(0), current_byte(0) {}
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)
{
@ -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)),
mode_(mode), header_top_(0), locs_(std::stack<location>()), readers_(std::stack<reader>())
lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)),
locs_(std::stack<location>()), readers_(std::stack<reader>()), header_top_(0), mode_(mode), indev_(false), clean_(true)
{
reader_.init(data, size);
}
@ -494,7 +495,7 @@ auto lexer::lex() -> parser::symbol_type
default:
if (last >= '0' && last <= '9')
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;
throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last));
@ -597,7 +598,7 @@ lex_name:
}
else
{
for (auto i = 0; i < buffer_.length; i++)
for (auto i = 0u; i < buffer_.length; i++)
{
auto c = buffer_.data[i];
@ -670,7 +671,7 @@ lex_number:
if (last == '\'')
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");
if (dot || flt)
@ -687,7 +688,7 @@ lex_number:
if (state == reader::end)
break;
if (curr == '\'' && (last == '\'' || last == 'o') || (curr == 'o' && last == '\''))
if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\''))
throw comp_error(loc_, "invalid octal literal");
if (curr == '\'')
@ -721,7 +722,7 @@ lex_number:
if (state == reader::end)
break;
if (curr == '\'' && (last == '\'' || last == 'b') || (curr == 'b' && last == '\''))
if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\''))
throw comp_error(loc_, "invalid binary literal");
if (curr == '\'')
@ -755,7 +756,7 @@ lex_number:
if (state == reader::end)
break;
if (curr == '\'' && (last == '\'' || last == 'x') || (curr == 'x' && last == '\''))
if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\''))
throw comp_error(loc_, "invalid hexadecimal literal");
if (curr == '\'')

View File

@ -13,7 +13,7 @@ constexpr size_t max_buf_size = 0x2000;
struct buffer
{
char* data;
int length;
std::uint32_t length;
buffer();
~buffer();
@ -32,9 +32,14 @@ struct 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;
}

File diff suppressed because it is too large Load Diff

View File

@ -593,79 +593,76 @@ namespace xsk { namespace arc { namespace t6 {
// stmt_break
char dummy58[sizeof (ast::stmt_break::ptr)];
// stmt_breakpoint
char dummy59[sizeof (ast::stmt_breakpoint::ptr)];
// stmt_call
char dummy60[sizeof (ast::stmt_call::ptr)];
char dummy59[sizeof (ast::stmt_call::ptr)];
// stmt_case
char dummy61[sizeof (ast::stmt_case::ptr)];
char dummy60[sizeof (ast::stmt_case::ptr)];
// stmt_continue
char dummy62[sizeof (ast::stmt_continue::ptr)];
char dummy61[sizeof (ast::stmt_continue::ptr)];
// stmt_default
char dummy63[sizeof (ast::stmt_default::ptr)];
char dummy62[sizeof (ast::stmt_default::ptr)];
// stmt_dev
char dummy64[sizeof (ast::stmt_dev::ptr)];
char dummy63[sizeof (ast::stmt_dev::ptr)];
// stmt_dowhile
char dummy65[sizeof (ast::stmt_dowhile::ptr)];
char dummy64[sizeof (ast::stmt_dowhile::ptr)];
// stmt_endon
char dummy66[sizeof (ast::stmt_endon::ptr)];
char dummy65[sizeof (ast::stmt_endon::ptr)];
// stmt_expr
char dummy67[sizeof (ast::stmt_expr::ptr)];
char dummy66[sizeof (ast::stmt_expr::ptr)];
// stmt_for
char dummy68[sizeof (ast::stmt_for::ptr)];
char dummy67[sizeof (ast::stmt_for::ptr)];
// stmt_foreach
char dummy69[sizeof (ast::stmt_foreach::ptr)];
char dummy68[sizeof (ast::stmt_foreach::ptr)];
// stmt_if
char dummy70[sizeof (ast::stmt_if::ptr)];
char dummy69[sizeof (ast::stmt_if::ptr)];
// stmt_ifelse
char dummy71[sizeof (ast::stmt_ifelse::ptr)];
char dummy70[sizeof (ast::stmt_ifelse::ptr)];
// stmt_list
// stmt_or_dev_list
// stmt_block
char dummy72[sizeof (ast::stmt_list::ptr)];
char dummy71[sizeof (ast::stmt_list::ptr)];
// stmt_notify
char dummy73[sizeof (ast::stmt_notify::ptr)];
char dummy72[sizeof (ast::stmt_notify::ptr)];
// stmt_prof_begin
char dummy74[sizeof (ast::stmt_prof_begin::ptr)];
char dummy73[sizeof (ast::stmt_prof_begin::ptr)];
// stmt_prof_end
char dummy75[sizeof (ast::stmt_prof_end::ptr)];
char dummy74[sizeof (ast::stmt_prof_end::ptr)];
// stmt_return
char dummy76[sizeof (ast::stmt_return::ptr)];
char dummy75[sizeof (ast::stmt_return::ptr)];
// stmt_switch
char dummy77[sizeof (ast::stmt_switch::ptr)];
char dummy76[sizeof (ast::stmt_switch::ptr)];
// stmt_wait
char dummy78[sizeof (ast::stmt_wait::ptr)];
char dummy77[sizeof (ast::stmt_wait::ptr)];
// stmt_waittill
char dummy79[sizeof (ast::stmt_waittill::ptr)];
char dummy78[sizeof (ast::stmt_waittill::ptr)];
// stmt_waittillframeend
char dummy80[sizeof (ast::stmt_waittillframeend::ptr)];
char dummy79[sizeof (ast::stmt_waittillframeend::ptr)];
// stmt_waittillmatch
char dummy81[sizeof (ast::stmt_waittillmatch::ptr)];
char dummy80[sizeof (ast::stmt_waittillmatch::ptr)];
// stmt_while
char dummy82[sizeof (ast::stmt_while::ptr)];
char dummy81[sizeof (ast::stmt_while::ptr)];
// "path"
// "identifier"
@ -674,7 +671,7 @@ namespace xsk { namespace arc { namespace t6 {
// "hash"
// "float"
// "integer"
char dummy83[sizeof (std::string)];
char dummy82[sizeof (std::string)];
};
/// The size of the largest semantic type.
@ -758,98 +755,97 @@ namespace xsk { namespace arc { namespace t6 {
BREAK = 32, // "break"
CONTINUE = 33, // "continue"
RETURN = 34, // "return"
BREAKPOINT = 35, // "breakpoint"
PROFBEGIN = 36, // "prof_begin"
PROFEND = 37, // "prof_end"
THREAD = 38, // "thread"
TRUE = 39, // "true"
FALSE = 40, // "false"
UNDEFINED = 41, // "undefined"
SIZE = 42, // "size"
GAME = 43, // "game"
SELF = 44, // "self"
ANIM = 45, // "anim"
LEVEL = 46, // "level"
GETNEXTARRAYKEY = 47, // "getnextarraykey"
GETFIRSTARRAYKEY = 48, // "getfirstarraykey"
GETDVARCOLORALPHA = 49, // "getdvarcoloralpha"
GETDVARCOLORBLUE = 50, // "getdvarcolorblue"
GETDVARCOLORGREEN = 51, // "getdvarcolorgreen"
GETDVARCOLORRED = 52, // "getdvarcolorred"
GETDVARVECTOR = 53, // "getdvarvector"
GETDVARFLOAT = 54, // "getdvarfloat"
GETDVARINT = 55, // "getdvarint"
GETDVAR = 56, // "getdvar"
GETTIME = 57, // "gettime"
ABS = 58, // "abs"
VECTORTOANGLES = 59, // "vectortoangles"
ANGLECLAMP180 = 60, // "angleclamp180"
ANGLESTOFORWARD = 61, // "anglestoforward"
ANGLESTORIGHT = 62, // "anglestoright"
ANGLESTOUP = 63, // "anglestoup"
VECTORSCALE = 64, // "vectorscale"
ISDEFINED = 65, // "isdefined"
LPAREN = 66, // "("
RPAREN = 67, // ")"
LBRACE = 68, // "{"
RBRACE = 69, // "}"
LBRACKET = 70, // "["
RBRACKET = 71, // "]"
COMMA = 72, // ","
DOT = 73, // "."
DOUBLECOLON = 74, // "::"
COLON = 75, // ":"
SEMICOLON = 76, // ";"
QMARK = 77, // "?"
INCREMENT = 78, // "++"
DECREMENT = 79, // "--"
LSHIFT = 80, // "<<"
RSHIFT = 81, // ">>"
OR = 82, // "||"
AND = 83, // "&&"
EQUALITY = 84, // "=="
INEQUALITY = 85, // "!="
LESS_EQUAL = 86, // "<="
GREATER_EQUAL = 87, // ">="
LESS = 88, // "<"
GREATER = 89, // ">"
NOT = 90, // "!"
COMPLEMENT = 91, // "~"
ASSIGN = 92, // "="
ASSIGN_ADD = 93, // "+="
ASSIGN_SUB = 94, // "-="
ASSIGN_MUL = 95, // "*="
ASSIGN_DIV = 96, // "/="
ASSIGN_MOD = 97, // "%="
ASSIGN_BW_OR = 98, // "|="
ASSIGN_BW_AND = 99, // "&="
ASSIGN_BW_EXOR = 100, // "^="
ASSIGN_RSHIFT = 101, // ">>="
ASSIGN_LSHIFT = 102, // "<<="
BITWISE_OR = 103, // "|"
BITWISE_AND = 104, // "&"
BITWISE_EXOR = 105, // "^"
ADD = 106, // "+"
SUB = 107, // "-"
MUL = 108, // "*"
DIV = 109, // "/"
MOD = 110, // "%"
PATH = 111, // "path"
IDENTIFIER = 112, // "identifier"
STRING = 113, // "string literal"
ISTRING = 114, // "localized string"
HASH = 115, // "hash"
FLOAT = 116, // "float"
INTEGER = 117, // "integer"
SIZEOF = 118, // SIZEOF
THEN = 119, // THEN
TERN = 120, // TERN
NEG = 121, // NEG
ANIMREF = 122, // ANIMREF
PREINC = 123, // PREINC
PREDEC = 124, // PREDEC
POSTINC = 125, // POSTINC
POSTDEC = 126 // POSTDEC
PROFBEGIN = 35, // "prof_begin"
PROFEND = 36, // "prof_end"
THREAD = 37, // "thread"
TRUE = 38, // "true"
FALSE = 39, // "false"
UNDEFINED = 40, // "undefined"
SIZE = 41, // "size"
GAME = 42, // "game"
SELF = 43, // "self"
ANIM = 44, // "anim"
LEVEL = 45, // "level"
GETNEXTARRAYKEY = 46, // "getnextarraykey"
GETFIRSTARRAYKEY = 47, // "getfirstarraykey"
GETDVARCOLORALPHA = 48, // "getdvarcoloralpha"
GETDVARCOLORBLUE = 49, // "getdvarcolorblue"
GETDVARCOLORGREEN = 50, // "getdvarcolorgreen"
GETDVARCOLORRED = 51, // "getdvarcolorred"
GETDVARVECTOR = 52, // "getdvarvector"
GETDVARFLOAT = 53, // "getdvarfloat"
GETDVARINT = 54, // "getdvarint"
GETDVAR = 55, // "getdvar"
GETTIME = 56, // "gettime"
ABS = 57, // "abs"
VECTORTOANGLES = 58, // "vectortoangles"
ANGLECLAMP180 = 59, // "angleclamp180"
ANGLESTOFORWARD = 60, // "anglestoforward"
ANGLESTORIGHT = 61, // "anglestoright"
ANGLESTOUP = 62, // "anglestoup"
VECTORSCALE = 63, // "vectorscale"
ISDEFINED = 64, // "isdefined"
LPAREN = 65, // "("
RPAREN = 66, // ")"
LBRACE = 67, // "{"
RBRACE = 68, // "}"
LBRACKET = 69, // "["
RBRACKET = 70, // "]"
COMMA = 71, // ","
DOT = 72, // "."
DOUBLECOLON = 73, // "::"
COLON = 74, // ":"
SEMICOLON = 75, // ";"
QMARK = 76, // "?"
INCREMENT = 77, // "++"
DECREMENT = 78, // "--"
LSHIFT = 79, // "<<"
RSHIFT = 80, // ">>"
OR = 81, // "||"
AND = 82, // "&&"
EQUALITY = 83, // "=="
INEQUALITY = 84, // "!="
LESS_EQUAL = 85, // "<="
GREATER_EQUAL = 86, // ">="
LESS = 87, // "<"
GREATER = 88, // ">"
NOT = 89, // "!"
COMPLEMENT = 90, // "~"
ASSIGN = 91, // "="
ASSIGN_ADD = 92, // "+="
ASSIGN_SUB = 93, // "-="
ASSIGN_MUL = 94, // "*="
ASSIGN_DIV = 95, // "/="
ASSIGN_MOD = 96, // "%="
ASSIGN_BW_OR = 97, // "|="
ASSIGN_BW_AND = 98, // "&="
ASSIGN_BW_EXOR = 99, // "^="
ASSIGN_RSHIFT = 100, // ">>="
ASSIGN_LSHIFT = 101, // "<<="
BITWISE_OR = 102, // "|"
BITWISE_AND = 103, // "&"
BITWISE_EXOR = 104, // "^"
ADD = 105, // "+"
SUB = 106, // "-"
MUL = 107, // "*"
DIV = 108, // "/"
MOD = 109, // "%"
PATH = 110, // "path"
IDENTIFIER = 111, // "identifier"
STRING = 112, // "string literal"
ISTRING = 113, // "localized string"
HASH = 114, // "hash"
FLOAT = 115, // "float"
INTEGER = 116, // "integer"
SIZEOF = 117, // SIZEOF
THEN = 118, // THEN
TERN = 119, // TERN
NEG = 120, // NEG
ANIMREF = 121, // ANIMREF
PREINC = 122, // PREINC
PREDEC = 123, // PREDEC
POSTINC = 124, // POSTINC
POSTDEC = 125 // POSTDEC
};
/// Backward compatibility alias (Bison 3.6).
typedef token_kind_type yytokentype;
@ -866,7 +862,7 @@ namespace xsk { namespace arc { namespace t6 {
{
enum symbol_kind_type
{
YYNTOKENS = 127, ///< Number of tokens.
YYNTOKENS = 126, ///< Number of tokens.
S_YYEMPTY = -2,
S_YYEOF = 0, // "end of file"
S_YYerror = 1, // error
@ -903,197 +899,195 @@ namespace xsk { namespace arc { namespace t6 {
S_BREAK = 32, // "break"
S_CONTINUE = 33, // "continue"
S_RETURN = 34, // "return"
S_BREAKPOINT = 35, // "breakpoint"
S_PROFBEGIN = 36, // "prof_begin"
S_PROFEND = 37, // "prof_end"
S_THREAD = 38, // "thread"
S_TRUE = 39, // "true"
S_FALSE = 40, // "false"
S_UNDEFINED = 41, // "undefined"
S_SIZE = 42, // "size"
S_GAME = 43, // "game"
S_SELF = 44, // "self"
S_ANIM = 45, // "anim"
S_LEVEL = 46, // "level"
S_GETNEXTARRAYKEY = 47, // "getnextarraykey"
S_GETFIRSTARRAYKEY = 48, // "getfirstarraykey"
S_GETDVARCOLORALPHA = 49, // "getdvarcoloralpha"
S_GETDVARCOLORBLUE = 50, // "getdvarcolorblue"
S_GETDVARCOLORGREEN = 51, // "getdvarcolorgreen"
S_GETDVARCOLORRED = 52, // "getdvarcolorred"
S_GETDVARVECTOR = 53, // "getdvarvector"
S_GETDVARFLOAT = 54, // "getdvarfloat"
S_GETDVARINT = 55, // "getdvarint"
S_GETDVAR = 56, // "getdvar"
S_GETTIME = 57, // "gettime"
S_ABS = 58, // "abs"
S_VECTORTOANGLES = 59, // "vectortoangles"
S_ANGLECLAMP180 = 60, // "angleclamp180"
S_ANGLESTOFORWARD = 61, // "anglestoforward"
S_ANGLESTORIGHT = 62, // "anglestoright"
S_ANGLESTOUP = 63, // "anglestoup"
S_VECTORSCALE = 64, // "vectorscale"
S_ISDEFINED = 65, // "isdefined"
S_LPAREN = 66, // "("
S_RPAREN = 67, // ")"
S_LBRACE = 68, // "{"
S_RBRACE = 69, // "}"
S_LBRACKET = 70, // "["
S_RBRACKET = 71, // "]"
S_COMMA = 72, // ","
S_DOT = 73, // "."
S_DOUBLECOLON = 74, // "::"
S_COLON = 75, // ":"
S_SEMICOLON = 76, // ";"
S_QMARK = 77, // "?"
S_INCREMENT = 78, // "++"
S_DECREMENT = 79, // "--"
S_LSHIFT = 80, // "<<"
S_RSHIFT = 81, // ">>"
S_OR = 82, // "||"
S_AND = 83, // "&&"
S_EQUALITY = 84, // "=="
S_INEQUALITY = 85, // "!="
S_LESS_EQUAL = 86, // "<="
S_GREATER_EQUAL = 87, // ">="
S_LESS = 88, // "<"
S_GREATER = 89, // ">"
S_NOT = 90, // "!"
S_COMPLEMENT = 91, // "~"
S_ASSIGN = 92, // "="
S_ASSIGN_ADD = 93, // "+="
S_ASSIGN_SUB = 94, // "-="
S_ASSIGN_MUL = 95, // "*="
S_ASSIGN_DIV = 96, // "/="
S_ASSIGN_MOD = 97, // "%="
S_ASSIGN_BW_OR = 98, // "|="
S_ASSIGN_BW_AND = 99, // "&="
S_ASSIGN_BW_EXOR = 100, // "^="
S_ASSIGN_RSHIFT = 101, // ">>="
S_ASSIGN_LSHIFT = 102, // "<<="
S_BITWISE_OR = 103, // "|"
S_BITWISE_AND = 104, // "&"
S_BITWISE_EXOR = 105, // "^"
S_ADD = 106, // "+"
S_SUB = 107, // "-"
S_MUL = 108, // "*"
S_DIV = 109, // "/"
S_MOD = 110, // "%"
S_PATH = 111, // "path"
S_IDENTIFIER = 112, // "identifier"
S_STRING = 113, // "string literal"
S_ISTRING = 114, // "localized string"
S_HASH = 115, // "hash"
S_FLOAT = 116, // "float"
S_INTEGER = 117, // "integer"
S_SIZEOF = 118, // SIZEOF
S_THEN = 119, // THEN
S_TERN = 120, // TERN
S_NEG = 121, // NEG
S_ANIMREF = 122, // ANIMREF
S_PREINC = 123, // PREINC
S_PREDEC = 124, // PREDEC
S_POSTINC = 125, // POSTINC
S_POSTDEC = 126, // POSTDEC
S_YYACCEPT = 127, // $accept
S_root = 128, // root
S_program = 129, // program
S_inline = 130, // inline
S_include = 131, // include
S_declaration = 132, // declaration
S_decl_usingtree = 133, // decl_usingtree
S_decl_constant = 134, // decl_constant
S_decl_thread = 135, // decl_thread
S_stmt = 136, // stmt
S_stmt_or_dev = 137, // stmt_or_dev
S_stmt_list = 138, // stmt_list
S_stmt_or_dev_list = 139, // stmt_or_dev_list
S_stmt_dev = 140, // stmt_dev
S_stmt_block = 141, // stmt_block
S_stmt_expr = 142, // stmt_expr
S_stmt_call = 143, // stmt_call
S_stmt_assign = 144, // stmt_assign
S_stmt_endon = 145, // stmt_endon
S_stmt_notify = 146, // stmt_notify
S_stmt_wait = 147, // stmt_wait
S_stmt_waittill = 148, // stmt_waittill
S_stmt_waittillmatch = 149, // stmt_waittillmatch
S_stmt_waittillframeend = 150, // stmt_waittillframeend
S_stmt_if = 151, // stmt_if
S_stmt_ifelse = 152, // stmt_ifelse
S_stmt_while = 153, // stmt_while
S_stmt_dowhile = 154, // stmt_dowhile
S_stmt_for = 155, // stmt_for
S_stmt_foreach = 156, // stmt_foreach
S_stmt_switch = 157, // stmt_switch
S_stmt_case = 158, // stmt_case
S_stmt_default = 159, // stmt_default
S_stmt_break = 160, // stmt_break
S_stmt_continue = 161, // stmt_continue
S_stmt_return = 162, // stmt_return
S_stmt_breakpoint = 163, // stmt_breakpoint
S_stmt_prof_begin = 164, // stmt_prof_begin
S_stmt_prof_end = 165, // stmt_prof_end
S_expr = 166, // expr
S_expr_or_empty = 167, // expr_or_empty
S_expr_assign = 168, // expr_assign
S_expr_increment = 169, // expr_increment
S_expr_decrement = 170, // expr_decrement
S_expr_ternary = 171, // expr_ternary
S_expr_binary = 172, // expr_binary
S_expr_primitive = 173, // expr_primitive
S_expr_complement = 174, // expr_complement
S_expr_not = 175, // expr_not
S_expr_call = 176, // expr_call
S_expr_method = 177, // expr_method
S_expr_function = 178, // expr_function
S_expr_pointer = 179, // expr_pointer
S_expr_parameters = 180, // expr_parameters
S_expr_arguments = 181, // expr_arguments
S_expr_arguments_no_empty = 182, // expr_arguments_no_empty
S_expr_getnextarraykey = 183, // expr_getnextarraykey
S_expr_getfirstarraykey = 184, // expr_getfirstarraykey
S_expr_getdvarcoloralpha = 185, // expr_getdvarcoloralpha
S_expr_getdvarcolorblue = 186, // expr_getdvarcolorblue
S_expr_getdvarcolorgreen = 187, // expr_getdvarcolorgreen
S_expr_getdvarcolorred = 188, // expr_getdvarcolorred
S_expr_getdvarvector = 189, // expr_getdvarvector
S_expr_getdvarfloat = 190, // expr_getdvarfloat
S_expr_getdvarint = 191, // expr_getdvarint
S_expr_getdvar = 192, // expr_getdvar
S_expr_gettime = 193, // expr_gettime
S_expr_abs = 194, // expr_abs
S_expr_vectortoangles = 195, // expr_vectortoangles
S_expr_angleclamp180 = 196, // expr_angleclamp180
S_expr_anglestoforward = 197, // expr_anglestoforward
S_expr_anglestoright = 198, // expr_anglestoright
S_expr_anglestoup = 199, // expr_anglestoup
S_expr_vectorscale = 200, // expr_vectorscale
S_expr_isdefined = 201, // expr_isdefined
S_expr_reference = 202, // expr_reference
S_expr_array = 203, // expr_array
S_expr_field = 204, // expr_field
S_expr_size = 205, // expr_size
S_expr_paren = 206, // expr_paren
S_expr_object = 207, // expr_object
S_expr_empty_array = 208, // expr_empty_array
S_expr_undefined = 209, // expr_undefined
S_expr_game = 210, // expr_game
S_expr_self = 211, // expr_self
S_expr_anim = 212, // expr_anim
S_expr_level = 213, // expr_level
S_expr_animation = 214, // expr_animation
S_expr_identifier_nosize = 215, // expr_identifier_nosize
S_expr_identifier = 216, // expr_identifier
S_expr_path = 217, // expr_path
S_expr_istring = 218, // expr_istring
S_expr_string = 219, // expr_string
S_expr_vector = 220, // expr_vector
S_expr_hash = 221, // expr_hash
S_expr_float = 222, // expr_float
S_expr_integer = 223, // expr_integer
S_expr_false = 224, // expr_false
S_expr_true = 225 // expr_true
S_PROFBEGIN = 35, // "prof_begin"
S_PROFEND = 36, // "prof_end"
S_THREAD = 37, // "thread"
S_TRUE = 38, // "true"
S_FALSE = 39, // "false"
S_UNDEFINED = 40, // "undefined"
S_SIZE = 41, // "size"
S_GAME = 42, // "game"
S_SELF = 43, // "self"
S_ANIM = 44, // "anim"
S_LEVEL = 45, // "level"
S_GETNEXTARRAYKEY = 46, // "getnextarraykey"
S_GETFIRSTARRAYKEY = 47, // "getfirstarraykey"
S_GETDVARCOLORALPHA = 48, // "getdvarcoloralpha"
S_GETDVARCOLORBLUE = 49, // "getdvarcolorblue"
S_GETDVARCOLORGREEN = 50, // "getdvarcolorgreen"
S_GETDVARCOLORRED = 51, // "getdvarcolorred"
S_GETDVARVECTOR = 52, // "getdvarvector"
S_GETDVARFLOAT = 53, // "getdvarfloat"
S_GETDVARINT = 54, // "getdvarint"
S_GETDVAR = 55, // "getdvar"
S_GETTIME = 56, // "gettime"
S_ABS = 57, // "abs"
S_VECTORTOANGLES = 58, // "vectortoangles"
S_ANGLECLAMP180 = 59, // "angleclamp180"
S_ANGLESTOFORWARD = 60, // "anglestoforward"
S_ANGLESTORIGHT = 61, // "anglestoright"
S_ANGLESTOUP = 62, // "anglestoup"
S_VECTORSCALE = 63, // "vectorscale"
S_ISDEFINED = 64, // "isdefined"
S_LPAREN = 65, // "("
S_RPAREN = 66, // ")"
S_LBRACE = 67, // "{"
S_RBRACE = 68, // "}"
S_LBRACKET = 69, // "["
S_RBRACKET = 70, // "]"
S_COMMA = 71, // ","
S_DOT = 72, // "."
S_DOUBLECOLON = 73, // "::"
S_COLON = 74, // ":"
S_SEMICOLON = 75, // ";"
S_QMARK = 76, // "?"
S_INCREMENT = 77, // "++"
S_DECREMENT = 78, // "--"
S_LSHIFT = 79, // "<<"
S_RSHIFT = 80, // ">>"
S_OR = 81, // "||"
S_AND = 82, // "&&"
S_EQUALITY = 83, // "=="
S_INEQUALITY = 84, // "!="
S_LESS_EQUAL = 85, // "<="
S_GREATER_EQUAL = 86, // ">="
S_LESS = 87, // "<"
S_GREATER = 88, // ">"
S_NOT = 89, // "!"
S_COMPLEMENT = 90, // "~"
S_ASSIGN = 91, // "="
S_ASSIGN_ADD = 92, // "+="
S_ASSIGN_SUB = 93, // "-="
S_ASSIGN_MUL = 94, // "*="
S_ASSIGN_DIV = 95, // "/="
S_ASSIGN_MOD = 96, // "%="
S_ASSIGN_BW_OR = 97, // "|="
S_ASSIGN_BW_AND = 98, // "&="
S_ASSIGN_BW_EXOR = 99, // "^="
S_ASSIGN_RSHIFT = 100, // ">>="
S_ASSIGN_LSHIFT = 101, // "<<="
S_BITWISE_OR = 102, // "|"
S_BITWISE_AND = 103, // "&"
S_BITWISE_EXOR = 104, // "^"
S_ADD = 105, // "+"
S_SUB = 106, // "-"
S_MUL = 107, // "*"
S_DIV = 108, // "/"
S_MOD = 109, // "%"
S_PATH = 110, // "path"
S_IDENTIFIER = 111, // "identifier"
S_STRING = 112, // "string literal"
S_ISTRING = 113, // "localized string"
S_HASH = 114, // "hash"
S_FLOAT = 115, // "float"
S_INTEGER = 116, // "integer"
S_SIZEOF = 117, // SIZEOF
S_THEN = 118, // THEN
S_TERN = 119, // TERN
S_NEG = 120, // NEG
S_ANIMREF = 121, // ANIMREF
S_PREINC = 122, // PREINC
S_PREDEC = 123, // PREDEC
S_POSTINC = 124, // POSTINC
S_POSTDEC = 125, // POSTDEC
S_YYACCEPT = 126, // $accept
S_root = 127, // root
S_program = 128, // program
S_inline = 129, // inline
S_include = 130, // include
S_declaration = 131, // declaration
S_decl_usingtree = 132, // decl_usingtree
S_decl_constant = 133, // decl_constant
S_decl_thread = 134, // decl_thread
S_stmt = 135, // stmt
S_stmt_or_dev = 136, // stmt_or_dev
S_stmt_list = 137, // stmt_list
S_stmt_or_dev_list = 138, // stmt_or_dev_list
S_stmt_dev = 139, // stmt_dev
S_stmt_block = 140, // stmt_block
S_stmt_expr = 141, // stmt_expr
S_stmt_call = 142, // stmt_call
S_stmt_assign = 143, // stmt_assign
S_stmt_endon = 144, // stmt_endon
S_stmt_notify = 145, // stmt_notify
S_stmt_wait = 146, // stmt_wait
S_stmt_waittill = 147, // stmt_waittill
S_stmt_waittillmatch = 148, // stmt_waittillmatch
S_stmt_waittillframeend = 149, // stmt_waittillframeend
S_stmt_if = 150, // stmt_if
S_stmt_ifelse = 151, // stmt_ifelse
S_stmt_while = 152, // stmt_while
S_stmt_dowhile = 153, // stmt_dowhile
S_stmt_for = 154, // stmt_for
S_stmt_foreach = 155, // stmt_foreach
S_stmt_switch = 156, // stmt_switch
S_stmt_case = 157, // stmt_case
S_stmt_default = 158, // stmt_default
S_stmt_break = 159, // stmt_break
S_stmt_continue = 160, // stmt_continue
S_stmt_return = 161, // stmt_return
S_stmt_prof_begin = 162, // stmt_prof_begin
S_stmt_prof_end = 163, // stmt_prof_end
S_expr = 164, // expr
S_expr_or_empty = 165, // expr_or_empty
S_expr_assign = 166, // expr_assign
S_expr_increment = 167, // expr_increment
S_expr_decrement = 168, // expr_decrement
S_expr_ternary = 169, // expr_ternary
S_expr_binary = 170, // expr_binary
S_expr_primitive = 171, // expr_primitive
S_expr_complement = 172, // expr_complement
S_expr_not = 173, // expr_not
S_expr_call = 174, // expr_call
S_expr_method = 175, // expr_method
S_expr_function = 176, // expr_function
S_expr_pointer = 177, // expr_pointer
S_expr_parameters = 178, // expr_parameters
S_expr_arguments = 179, // expr_arguments
S_expr_arguments_no_empty = 180, // expr_arguments_no_empty
S_expr_getnextarraykey = 181, // expr_getnextarraykey
S_expr_getfirstarraykey = 182, // expr_getfirstarraykey
S_expr_getdvarcoloralpha = 183, // expr_getdvarcoloralpha
S_expr_getdvarcolorblue = 184, // expr_getdvarcolorblue
S_expr_getdvarcolorgreen = 185, // expr_getdvarcolorgreen
S_expr_getdvarcolorred = 186, // expr_getdvarcolorred
S_expr_getdvarvector = 187, // expr_getdvarvector
S_expr_getdvarfloat = 188, // expr_getdvarfloat
S_expr_getdvarint = 189, // expr_getdvarint
S_expr_getdvar = 190, // expr_getdvar
S_expr_gettime = 191, // expr_gettime
S_expr_abs = 192, // expr_abs
S_expr_vectortoangles = 193, // expr_vectortoangles
S_expr_angleclamp180 = 194, // expr_angleclamp180
S_expr_anglestoforward = 195, // expr_anglestoforward
S_expr_anglestoright = 196, // expr_anglestoright
S_expr_anglestoup = 197, // expr_anglestoup
S_expr_vectorscale = 198, // expr_vectorscale
S_expr_isdefined = 199, // expr_isdefined
S_expr_reference = 200, // expr_reference
S_expr_array = 201, // expr_array
S_expr_field = 202, // expr_field
S_expr_size = 203, // expr_size
S_expr_paren = 204, // expr_paren
S_expr_object = 205, // expr_object
S_expr_empty_array = 206, // expr_empty_array
S_expr_undefined = 207, // expr_undefined
S_expr_game = 208, // expr_game
S_expr_self = 209, // expr_self
S_expr_anim = 210, // expr_anim
S_expr_level = 211, // expr_level
S_expr_animation = 212, // expr_animation
S_expr_identifier_nosize = 213, // expr_identifier_nosize
S_expr_identifier = 214, // expr_identifier
S_expr_path = 215, // expr_path
S_expr_istring = 216, // expr_istring
S_expr_string = 217, // expr_string
S_expr_vector = 218, // expr_vector
S_expr_hash = 219, // expr_hash
S_expr_float = 220, // expr_float
S_expr_integer = 221, // expr_integer
S_expr_false = 222, // expr_false
S_expr_true = 223 // expr_true
};
};
@ -1374,10 +1368,6 @@ namespace xsk { namespace arc { namespace t6 {
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;
@ -2317,20 +2307,6 @@ namespace xsk { namespace arc { namespace t6 {
{}
#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)
@ -2933,10 +2909,6 @@ switch (yykind)
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;
@ -3722,21 +3694,6 @@ switch (yykind)
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
@ -5446,8 +5403,8 @@ switch (yykind)
/// Constants.
enum
{
yylast_ = 2863, ///< Last index in yytable_.
yynnts_ = 99, ///< Number of nonterminal symbols.
yylast_ = 3411, ///< Last index in yytable_.
yynnts_ = 98, ///< Number of nonterminal symbols.
yyfinal_ = 22 ///< Termination state number.
};
@ -5718,10 +5675,6 @@ switch (yykind)
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;
@ -6099,10 +6052,6 @@ switch (yykind)
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;
@ -6270,7 +6219,7 @@ switch (yykind)
#line 13 "parser.ypp"
} } } // 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
{{
{ std::uint8_t(opcode::OP_End),"END" },
{ std::uint8_t(opcode::OP_Return),"RETN" },
{ std::uint8_t(opcode::OP_GetUndefined),"GET_UNDEFINED" },
{ std::uint8_t(opcode::OP_GetZero),"GET_ZERO" },
{ std::uint8_t(opcode::OP_GetByte),"GET_BYTE" },
{ std::uint8_t(opcode::OP_GetNegByte),"GET_NBYTE" },
{ std::uint8_t(opcode::OP_GetUnsignedShort),"GET_USHORT" },
{ std::uint8_t(opcode::OP_GetNegUnsignedShort),"GET_NUSHORT" },
{ std::uint8_t(opcode::OP_GetInteger),"GET_INT" },
{ std::uint8_t(opcode::OP_GetFloat),"GET_FLOAT" },
{ std::uint8_t(opcode::OP_GetString),"GET_STRING" },
{ std::uint8_t(opcode::OP_GetIString),"GET_ISTRING" },
{ std::uint8_t(opcode::OP_GetVector),"GET_VECTOR" },
{ std::uint8_t(opcode::OP_GetLevelObject),"GET_LEVEL_OBJ" },
{ std::uint8_t(opcode::OP_GetAnimObject),"GET_ANIM_OBJ" },
{ std::uint8_t(opcode::OP_GetSelf),"GET_SELF" },
{ std::uint8_t(opcode::OP_GetLevel),"GET_LEVEL" },
{ std::uint8_t(opcode::OP_GetGame),"GET_GAME" },
{ std::uint8_t(opcode::OP_GetAnim),"GET_ANIM" },
{ std::uint8_t(opcode::OP_GetAnimation),"GET_ANIMATION" },
{ std::uint8_t(opcode::OP_GetGameRef),"GET_GAME_REF" },
{ std::uint8_t(opcode::OP_GetFunction),"GET_FUNCTION" },
{ std::uint8_t(opcode::OP_CreateLocalVariable),"CREATE_LOCAL_VARIABLE" },
{ std::uint8_t(opcode::OP_SafeCreateLocalVariables),"SAFE_CREATE_LOCAL_VARIABLES" },
{ std::uint8_t(opcode::OP_RemoveLocalVariables),"REMOVE_LOCAL_VARIABLES" },
{ std::uint8_t(opcode::OP_EvalLocalVariableCached),"EVAL_LOCAL_VARIABLE_CACHED" },
{ std::uint8_t(opcode::OP_EvalArray),"EVAL_ARRAY" },
{ std::uint8_t(opcode::OP_EvalLocalArrayRefCached),"EVAL_LOCAL_ARRAY_REF_CACHED" },
{ std::uint8_t(opcode::OP_EvalArrayRef),"EVAL_ARRAY_REF" },
{ std::uint8_t(opcode::OP_ClearArray),"CLEAR_ARRAY" },
{ std::uint8_t(opcode::OP_EmptyArray),"EMPTY_ARRAY" },
{ std::uint8_t(opcode::OP_GetSelfObject),"GET_SELF_OBJECT" },
{ std::uint8_t(opcode::OP_EvalFieldVariable),"EVAL_FIELD_VARIABLE" },
{ std::uint8_t(opcode::OP_EvalFieldVariableRef),"EVAL_FIELD_VARIABLE_REF" },
{ std::uint8_t(opcode::OP_ClearFieldVariable),"CLEAR_FIELD_VARIABLE" },
{ std::uint8_t(opcode::OP_SafeSetVariableFieldCached),"SAFE_SET_VARIABLE_FIELD_CACHED" },
{ std::uint8_t(opcode::OP_SafeSetWaittillVariableFieldCached),"SAFE_SET_WAITTILL_VARIABLE_FIELD_CACHED" },
{ std::uint8_t(opcode::OP_ClearParams),"CLEAR_PARAMS" },
{ std::uint8_t(opcode::OP_CheckClearParams),"CHECK_CLEAR_PARAMS" },
{ std::uint8_t(opcode::OP_EvalLocalVariableRefCached),"EVAL_LOCAL_VARIABLE_REF_CACHED" },
{ std::uint8_t(opcode::OP_SetVariableField),"SET_VARIABLE_FIELD" },
{ std::uint8_t(opcode::OP_CallBuiltin),"CALL_BUILTIN_FUNC" },
{ std::uint8_t(opcode::OP_CallBuiltinMethod),"CALL_BUILTIN_METHOD" },
{ std::uint8_t(opcode::OP_Wait),"WAIT" },
{ std::uint8_t(opcode::OP_WaitTillFrameEnd),"WAITTILLFRAMEEND" },
{ std::uint8_t(opcode::OP_PreScriptCall),"PRE_CALL" },
{ std::uint8_t(opcode::OP_ScriptFunctionCall),"SCRIPT_FUNC_CALL" },
{ std::uint8_t(opcode::OP_ScriptFunctionCallPointer),"SCRIPT_FUNC_CALL_POINTER" },
{ std::uint8_t(opcode::OP_ScriptMethodCall),"SCRIPT_METHOD_CALL" },
{ std::uint8_t(opcode::OP_ScriptMethodCallPointer),"SCRIPT_METHOD_CALL_POINTER" },
{ std::uint8_t(opcode::OP_ScriptThreadCall),"SCRIPT_THREAD_CALL" },
{ std::uint8_t(opcode::OP_ScriptThreadCallPointer),"SCRIPT_THREAD_CALL_POINTER" },
{ std::uint8_t(opcode::OP_ScriptMethodThreadCall),"SCRIPT_METHOD_THREAD_CALL" },
{ std::uint8_t(opcode::OP_ScriptMethodThreadCallPointer),"SCRIPT_METHOD_THREAD_CALL_POINTER" },
{ std::uint8_t(opcode::OP_DecTop),"DEC_TOP" },
{ std::uint8_t(opcode::OP_CastFieldObject),"CAST_FIELD_OBJECT" },
{ std::uint8_t(opcode::OP_CastBool),"CAST_BOOL" },
{ std::uint8_t(opcode::OP_BoolNot),"BOOL_NOT" },
{ std::uint8_t(opcode::OP_BoolComplement),"BOOL_COMPLEMENT" },
{ std::uint8_t(opcode::OP_JumpOnFalse),"JMP_FALSE" },
{ std::uint8_t(opcode::OP_JumpOnTrue),"JMP_TRUE" },
{ std::uint8_t(opcode::OP_JumpOnFalseExpr),"JMP_EXPR_FALSE" },
{ std::uint8_t(opcode::OP_JumpOnTrueExpr),"JMP_EXPR_TRUE" },
{ std::uint8_t(opcode::OP_Jump),"JMP" },
{ std::uint8_t(opcode::OP_JumpBack),"JMP_BACK" },
{ std::uint8_t(opcode::OP_Inc),"INC" },
{ std::uint8_t(opcode::OP_Dec),"DEC" },
{ std::uint8_t(opcode::OP_Bit_Or),"BIT_OR" },
{ std::uint8_t(opcode::OP_Bit_Xor),"BIT_XOR" },
{ std::uint8_t(opcode::OP_Bit_And),"BIT_AND" },
{ std::uint8_t(opcode::OP_Equal),"EQUAL" },
{ std::uint8_t(opcode::OP_NotEqual),"NOT_EQUAL" },
{ std::uint8_t(opcode::OP_LessThan),"LESS" },
{ std::uint8_t(opcode::OP_GreaterThan),"GREATER" },
{ std::uint8_t(opcode::OP_LessThanOrEqualTo),"LESS_EQUAL" },
{ std::uint8_t(opcode::OP_GreaterThanOrEqualTo),"GREATER_EQUAL" },
{ std::uint8_t(opcode::OP_ShiftLeft),"SHIFT_LEFT" },
{ std::uint8_t(opcode::OP_ShiftRight),"SHIFT_RIGHT" },
{ std::uint8_t(opcode::OP_Plus),"PLUS" },
{ std::uint8_t(opcode::OP_Minus),"MINUS" },
{ std::uint8_t(opcode::OP_Multiply),"MULT" },
{ std::uint8_t(opcode::OP_Divide),"DIV" },
{ std::uint8_t(opcode::OP_Modulus),"MOD" },
{ std::uint8_t(opcode::OP_SizeOf),"SIZE" },
{ std::uint8_t(opcode::OP_WaitTillMatch),"WAITTILLMATCH" },
{ std::uint8_t(opcode::OP_WaitTill),"WAITTILL" },
{ std::uint8_t(opcode::OP_Notify),"NOTIFY" },
{ std::uint8_t(opcode::OP_EndOn),"ENDON" },
{ std::uint8_t(opcode::OP_VoidCodePos),"VOIDCODEPOS" },
{ std::uint8_t(opcode::OP_Switch),"SWITCH" },
{ std::uint8_t(opcode::OP_EndSwitch),"ENDSWITCH" },
{ std::uint8_t(opcode::OP_Vector),"VECTOR" },
{ std::uint8_t(opcode::OP_GetHash),"GET_HASH" },
{ std::uint8_t(opcode::OP_RealWait),"REAL_WAIT" },
{ std::uint8_t(opcode::OP_VectorConstant),"VECTOR_CONSTANT" },
{ std::uint8_t(opcode::OP_IsDefined),"IS_DEFINED" },
{ std::uint8_t(opcode::OP_VectorScale),"VECTOR_SCALE" },
{ std::uint8_t(opcode::OP_AnglesToUp),"ANGLES_TO_UP" },
{ std::uint8_t(opcode::OP_AnglesToRight),"ANGLES_TO_RIGHT" },
{ std::uint8_t(opcode::OP_AnglesToForward),"ANGLES_TO_FORDWARD" },
{ std::uint8_t(opcode::OP_AngleClamp180),"ANGLE_CLAMP_180" },
{ std::uint8_t(opcode::OP_VectorToAngles),"VECTOR_TO_ANGLES" },
{ std::uint8_t(opcode::OP_Abs),"ABS" },
{ std::uint8_t(opcode::OP_GetTime),"GET_TIME" },
{ std::uint8_t(opcode::OP_GetDvar),"GET_DVAR" },
{ std::uint8_t(opcode::OP_GetDvarInt),"GET_DVAR_INT" },
{ std::uint8_t(opcode::OP_GetDvarFloat),"GET_DVAR_FLOAT" },
{ std::uint8_t(opcode::OP_GetDvarVector),"GET_DVAR_VECTOR" },
{ std::uint8_t(opcode::OP_GetDvarColorRed),"GET_DVAR_COLOR_RED" },
{ std::uint8_t(opcode::OP_GetDvarColorGreen),"GET_DVAR_COLOR_GREEN" },
{ std::uint8_t(opcode::OP_GetDvarColorBlue),"GET_DVAR_COLOR_BLUE" },
{ std::uint8_t(opcode::OP_GetDvarColorAlpha),"GET_DVAR_COLOR_ALPHA" },
{ std::uint8_t(opcode::OP_FirstArrayKey),"FIRST_ARRAY_KEY" },
{ std::uint8_t(opcode::OP_NextArrayKey),"NEXT_ARRAY_KEY" },
{ std::uint8_t(opcode::OP_ProfileStart),"PROFILE_START" },
{ std::uint8_t(opcode::OP_ProfileStop),"PROFILE_STOP" },
{ std::uint8_t(opcode::OP_SafeDecTop),"SAFE_DEC_TOP" },
{ std::uint8_t(opcode::OP_Nop),"NOP" },
{ std::uint8_t(opcode::OP_Abort),"ABORT" },
{ std::uint8_t(opcode::OP_Object),"OBJECT" },
{ std::uint8_t(opcode::OP_ThreadObject),"THREAD_OBJECT" },
{ std::uint8_t(opcode::OP_EvalLocalVariable),"EVAL_LOCAL_VARIABLE" },
{ std::uint8_t(opcode::OP_EvalLocalVariableRef),"EVAL_LOCAL_VARIABLE_REF" },
{ std::uint8_t(opcode::OP_DevblockBegin),"DEVBLOCK_BEGIN" },
{ std::uint8_t(opcode::OP_DevblockEnd),"DEVBLOCK_END" },
{ std::uint8_t(opcode::OP_Breakpoint),"BREAKPOINT" },
{ 0x00, "OP_End" },
{ 0x01, "OP_Return" },
{ 0x02, "OP_GetUndefined" },
{ 0x03, "OP_GetZero" },
{ 0x04, "OP_GetByte" },
{ 0x05, "OP_GetNegByte" },
{ 0x06, "OP_GetUnsignedShort" },
{ 0x07, "OP_GetNegUnsignedShort" },
{ 0x08, "OP_GetInteger" },
{ 0x09, "OP_GetFloat" },
{ 0x0A, "OP_GetString" },
{ 0x0B, "OP_GetIString" },
{ 0x0C, "OP_GetVector" },
{ 0x0D, "OP_GetLevelObject" },
{ 0x0E, "OP_GetAnimObject" },
{ 0x0F, "OP_GetSelf" },
{ 0x10, "OP_GetLevel" },
{ 0x11, "OP_GetGame" },
{ 0x12, "OP_GetAnim" },
{ 0x13, "OP_GetAnimation" },
{ 0x14, "OP_GetGameRef" },
{ 0x15, "OP_GetFunction" },
{ 0x16, "OP_CreateLocalVariable" },
{ 0x17, "OP_SafeCreateLocalVariables" },
{ 0x18, "OP_RemoveLocalVariables" },
{ 0x19, "OP_EvalLocalVariableCached" },
{ 0x1A, "OP_EvalArray" },
{ 0x1B, "OP_EvalLocalArrayRefCached" },
{ 0x1C, "OP_EvalArrayRef" },
{ 0x1D, "OP_ClearArray" },
{ 0x1E, "OP_EmptyArray" },
{ 0x1F, "OP_GetSelfObject" },
{ 0x20, "OP_EvalFieldVariable" },
{ 0x21, "OP_EvalFieldVariableRef" },
{ 0x22, "OP_ClearFieldVariable" },
{ 0x23, "OP_SafeSetVariableFieldCached" },
{ 0x24, "OP_SafeSetWaittillVariableFieldCached" },
{ 0x25, "OP_ClearParams" },
{ 0x26, "OP_CheckClearParams" },
{ 0x27, "OP_EvalLocalVariableRefCached" },
{ 0x28, "OP_SetVariableField" },
{ 0x29, "OP_CallBuiltin" },
{ 0x2A, "OP_CallBuiltinMethod" },
{ 0x2B, "OP_Wait" },
{ 0x2C, "OP_WaitTillFrameEnd" },
{ 0x2D, "OP_PreScriptCall" },
{ 0x2E, "OP_ScriptFunctionCall" },
{ 0x2F, "OP_ScriptFunctionCallPointer" },
{ 0x30, "OP_ScriptMethodCall" },
{ 0x31, "OP_ScriptMethodCallPointer" },
{ 0x32, "OP_ScriptThreadCall" },
{ 0x33, "OP_ScriptThreadCallPointer" },
{ 0x34, "OP_ScriptMethodThreadCall" },
{ 0x35, "OP_ScriptMethodThreadCallPointer" },
{ 0x36, "OP_DecTop" },
{ 0x37, "OP_CastFieldObject" },
{ 0x38, "OP_CastBool" },
{ 0x39, "OP_BoolNot" },
{ 0x3A, "OP_BoolComplement" },
{ 0x3B, "OP_JumpOnFalse" },
{ 0x3C, "OP_JumpOnTrue" },
{ 0x3D, "OP_JumpOnFalseExpr" },
{ 0x3E, "OP_JumpOnTrueExpr" },
{ 0x3F, "OP_Jump" },
{ 0x40, "OP_JumpBack" },
{ 0x41, "OP_Inc" },
{ 0x42, "OP_Dec" },
{ 0x43, "OP_Bit_Or" },
{ 0x44, "OP_Bit_Xor" },
{ 0x45, "OP_Bit_And" },
{ 0x46, "OP_Equal" },
{ 0x47, "OP_NotEqual" },
{ 0x48, "OP_LessThan" },
{ 0x49, "OP_GreaterThan" },
{ 0x4A, "OP_LessThanOrEqualTo" },
{ 0x4B, "OP_GreaterThanOrEqualTo" },
{ 0x4C, "OP_ShiftLeft" },
{ 0x4D, "OP_ShiftRight" },
{ 0x4E, "OP_Plus" },
{ 0x4F, "OP_Minus" },
{ 0x50, "OP_Multiply" },
{ 0x51, "OP_Divide" },
{ 0x52, "OP_Modulus" },
{ 0x53, "OP_SizeOf" },
{ 0x54, "OP_WaitTillMatch" },
{ 0x55, "OP_WaitTill" },
{ 0x56, "OP_Notify" },
{ 0x57, "OP_EndOn" },
{ 0x58, "OP_VoidCodePos" },
{ 0x59, "OP_Switch" },
{ 0x5A, "OP_EndSwitch" },
{ 0x5B, "OP_Vector" },
{ 0x5C, "OP_GetHash" },
{ 0x5D, "OP_RealWait" },
{ 0x5E, "OP_VectorConstant" },
{ 0x5F, "OP_IsDefined" },
{ 0x60, "OP_VectorScale" },
{ 0x61, "OP_AnglesToUp" },
{ 0x62, "OP_AnglesToRight" },
{ 0x63, "OP_AnglesToForward" },
{ 0x64, "OP_AngleClamp180" },
{ 0x65, "OP_VectorToAngles" },
{ 0x66, "OP_Abs" },
{ 0x67, "OP_GetTime" },
{ 0x68, "OP_GetDvar" },
{ 0x69, "OP_GetDvarInt" },
{ 0x6A, "OP_GetDvarFloat" },
{ 0x6B, "OP_GetDvarVector" },
{ 0x6C, "OP_GetDvarColorRed" },
{ 0x6D, "OP_GetDvarColorGreen" },
{ 0x6E, "OP_GetDvarColorBlue" },
{ 0x6F, "OP_GetDvarColorAlpha" },
{ 0x70, "OP_FirstArrayKey" },
{ 0x71, "OP_NextArrayKey" },
{ 0x72, "OP_ProfileStart" },
{ 0x73, "OP_ProfileStop" },
{ 0x74, "OP_SafeDecTop" },
{ 0x75, "OP_Nop" },
{ 0x76, "OP_Abort" },
{ 0x77, "OP_Object" },
{ 0x78, "OP_ThreadObject" },
{ 0x79, "OP_EvalLocalVariable" },
{ 0x7A, "OP_EvalLocalVariableRef" },
{ 0x7B, "OP_DevblockBegin" },
{ 0x7C, "OP_DevblockEnd" },
}};
const std::array<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_EvalLocalVariable:
case opcode::OP_EvalLocalVariableRef:
case opcode::OP_Breakpoint:
return 1;
case opcode::OP_GetByte:
case opcode::OP_GetNegByte:

View File

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

View File

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