From 8c59bf78ee672e27c9c6dcf0ccdbd7fc2b303c8a Mon Sep 17 00:00:00 2001 From: xensik Date: Tue, 12 Apr 2022 19:13:10 +0200 Subject: [PATCH] fix warnings --- gen/h1/parser.ypp | 6 +- gen/h2/parser.ypp | 4 + gen/iw5/parser.ypp | 4 + gen/iw6/parser.ypp | 4 + gen/iw7/parser.ypp | 4 + gen/iw8/parser.ypp | 4 + gen/s1/parser.ypp | 4 + gen/s2/parser.ypp | 4 + gen/s4/parser.ypp | 4 + gen/t6/parser.ypp | 4 + src/experimental/iw5_console/stdafx.hpp | 38 +- src/experimental/iw6_console/stdafx.hpp | 38 +- src/experimental/s1_console/stdafx.hpp | 38 +- src/experimental/t4/stdafx.hpp | 39 +- src/experimental/t5/stdafx.hpp | 39 +- src/h1/stdafx.hpp | 42 +- src/h1/xsk/assembler.cpp | 22 +- src/h1/xsk/compiler.cpp | 4 +- src/h1/xsk/decompiler.cpp | 30 +- src/h1/xsk/decompiler.hpp | 26 +- src/h1/xsk/disassembler.cpp | 2 +- src/h1/xsk/lexer.cpp | 2 +- src/h1/xsk/parser.cpp | 526 ++++++++++----------- src/h1/xsk/parser.hpp | 152 +++--- src/h1/xsk/resolver.cpp | 19 +- src/h2/stdafx.hpp | 42 +- src/h2/xsk/assembler.cpp | 22 +- src/h2/xsk/compiler.cpp | 4 +- src/h2/xsk/decompiler.cpp | 30 +- src/h2/xsk/decompiler.hpp | 26 +- src/h2/xsk/disassembler.cpp | 2 +- src/h2/xsk/lexer.cpp | 2 +- src/h2/xsk/parser.cpp | 526 ++++++++++----------- src/h2/xsk/parser.hpp | 150 +++--- src/h2/xsk/resolver.cpp | 19 +- src/iw5/stdafx.hpp | 43 +- src/iw5/xsk/assembler.cpp | 22 +- src/iw5/xsk/compiler.cpp | 4 +- src/iw5/xsk/decompiler.cpp | 30 +- src/iw5/xsk/decompiler.hpp | 26 +- src/iw5/xsk/disassembler.cpp | 2 +- src/iw5/xsk/lexer.cpp | 2 +- src/iw5/xsk/parser.cpp | 518 ++++++++++---------- src/iw5/xsk/parser.hpp | 150 +++--- src/iw5/xsk/resolver.cpp | 19 +- src/iw6/stdafx.hpp | 42 +- src/iw6/xsk/assembler.cpp | 22 +- src/iw6/xsk/compiler.cpp | 4 +- src/iw6/xsk/decompiler.cpp | 30 +- src/iw6/xsk/decompiler.hpp | 26 +- src/iw6/xsk/disassembler.cpp | 2 +- src/iw6/xsk/lexer.cpp | 2 +- src/iw6/xsk/parser.cpp | 518 ++++++++++---------- src/iw6/xsk/parser.hpp | 150 +++--- src/iw6/xsk/resolver.cpp | 19 +- src/iw7/stdafx.hpp | 40 +- src/iw7/xsk/assembler.cpp | 20 +- src/iw7/xsk/compiler.cpp | 4 +- src/iw7/xsk/decompiler.cpp | 30 +- src/iw7/xsk/decompiler.hpp | 26 +- src/iw7/xsk/lexer.cpp | 2 +- src/iw7/xsk/parser.cpp | 518 ++++++++++---------- src/iw7/xsk/parser.hpp | 150 +++--- src/iw7/xsk/resolver.cpp | 19 +- src/iw8/stdafx.hpp | 42 +- src/iw8/xsk/assembler.cpp | 20 +- src/iw8/xsk/compiler.cpp | 6 +- src/iw8/xsk/decompiler.cpp | 30 +- src/iw8/xsk/decompiler.hpp | 26 +- src/iw8/xsk/lexer.cpp | 2 +- src/iw8/xsk/parser.cpp | 534 ++++++++++----------- src/iw8/xsk/parser.hpp | 150 +++--- src/iw8/xsk/resolver.cpp | 19 +- src/s1/stdafx.hpp | 42 +- src/s1/xsk/assembler.cpp | 22 +- src/s1/xsk/compiler.cpp | 4 +- src/s1/xsk/decompiler.cpp | 30 +- src/s1/xsk/decompiler.hpp | 26 +- src/s1/xsk/disassembler.cpp | 2 +- src/s1/xsk/lexer.cpp | 2 +- src/s1/xsk/parser.cpp | 526 ++++++++++----------- src/s1/xsk/parser.hpp | 150 +++--- src/s1/xsk/resolver.cpp | 19 +- src/s2/stdafx.hpp | 42 +- src/s2/xsk/assembler.cpp | 22 +- src/s2/xsk/compiler.cpp | 4 +- src/s2/xsk/decompiler.cpp | 30 +- src/s2/xsk/decompiler.hpp | 26 +- src/s2/xsk/disassembler.cpp | 2 +- src/s2/xsk/lexer.cpp | 2 +- src/s2/xsk/parser.cpp | 526 ++++++++++----------- src/s2/xsk/parser.hpp | 150 +++--- src/s2/xsk/resolver.cpp | 19 +- src/s4/stdafx.hpp | 42 +- src/s4/xsk/assembler.cpp | 20 +- src/s4/xsk/compiler.cpp | 6 +- src/s4/xsk/decompiler.cpp | 30 +- src/s4/xsk/decompiler.hpp | 26 +- src/s4/xsk/lexer.cpp | 2 +- src/s4/xsk/parser.cpp | 534 ++++++++++----------- src/s4/xsk/parser.hpp | 150 +++--- src/s4/xsk/resolver.cpp | 19 +- src/t6/stdafx.hpp | 42 +- src/t6/xsk/assembler.cpp | 30 +- src/t6/xsk/assembler.hpp | 2 +- src/t6/xsk/compiler.cpp | 2 +- src/t6/xsk/decompiler.cpp | 28 +- src/t6/xsk/decompiler.hpp | 24 +- src/t6/xsk/disassembler.cpp | 2 +- src/t6/xsk/lexer.cpp | 2 +- src/t6/xsk/parser.cpp | 596 ++++++++++++------------ src/t6/xsk/parser.hpp | 150 +++--- src/t6/xsk/resolver.cpp | 9 + src/tool/stdafx.hpp | 40 +- src/tool/xsk/main.cpp | 13 +- src/utils/stdafx.hpp | 39 +- src/utils/xsk/gsc/asset.cpp | 4 +- src/utils/xsk/gsc/block.cpp | 8 +- src/utils/xsk/utils.hpp | 5 - src/utils/xsk/utils/byte_buffer.cpp | 49 +- src/utils/xsk/utils/byte_buffer.hpp | 26 +- src/utils/xsk/utils/compression.cpp | 2 +- src/utils/xsk/utils/string.cpp | 6 +- 123 files changed, 4465 insertions(+), 4240 deletions(-) diff --git a/gen/h1/parser.ypp b/gen/h1/parser.ypp index 50deb346..aa10662c 100644 --- a/gen/h1/parser.ypp +++ b/gen/h1/parser.ypp @@ -26,10 +26,12 @@ %code requires { +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "h1.hpp" namespace xsk::gsc::h1 { class lexer; } -typedef void *yyscan_t; -#define YY_DECL xsk::gsc::h1::parser::symbol_type yylex(yyscan_t yyscanner, xsk::gsc::location& loc) } %code top diff --git a/gen/h2/parser.ypp b/gen/h2/parser.ypp index 65301957..4174cae2 100644 --- a/gen/h2/parser.ypp +++ b/gen/h2/parser.ypp @@ -26,6 +26,10 @@ %code requires { +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "h2.hpp" namespace xsk::gsc::h2 { class lexer; } } diff --git a/gen/iw5/parser.ypp b/gen/iw5/parser.ypp index 75edf07b..8769f332 100644 --- a/gen/iw5/parser.ypp +++ b/gen/iw5/parser.ypp @@ -26,6 +26,10 @@ %code requires { +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "iw5.hpp" namespace xsk::gsc::iw5 { class lexer; } } diff --git a/gen/iw6/parser.ypp b/gen/iw6/parser.ypp index dde4dc9a..ed228d52 100644 --- a/gen/iw6/parser.ypp +++ b/gen/iw6/parser.ypp @@ -26,6 +26,10 @@ %code requires { +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "iw6.hpp" namespace xsk::gsc::iw6 { class lexer; } } diff --git a/gen/iw7/parser.ypp b/gen/iw7/parser.ypp index 8957505a..2be5365a 100644 --- a/gen/iw7/parser.ypp +++ b/gen/iw7/parser.ypp @@ -26,6 +26,10 @@ %code requires { +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "iw7.hpp" namespace xsk::gsc::iw7 { class lexer; } } diff --git a/gen/iw8/parser.ypp b/gen/iw8/parser.ypp index 7ba5235e..ffe41720 100644 --- a/gen/iw8/parser.ypp +++ b/gen/iw8/parser.ypp @@ -26,6 +26,10 @@ %code requires { +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "iw8.hpp" namespace xsk::gsc::iw8 { class lexer; } } diff --git a/gen/s1/parser.ypp b/gen/s1/parser.ypp index a5294d28..9524e552 100644 --- a/gen/s1/parser.ypp +++ b/gen/s1/parser.ypp @@ -26,6 +26,10 @@ %code requires { +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "s1.hpp" namespace xsk::gsc::s1 { class lexer; } } diff --git a/gen/s2/parser.ypp b/gen/s2/parser.ypp index c5b5f2c0..d1bf3c53 100644 --- a/gen/s2/parser.ypp +++ b/gen/s2/parser.ypp @@ -26,6 +26,10 @@ %code requires { +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "s2.hpp" namespace xsk::gsc::s2 { class lexer; } } diff --git a/gen/s4/parser.ypp b/gen/s4/parser.ypp index c355d4a8..99aaa844 100644 --- a/gen/s4/parser.ypp +++ b/gen/s4/parser.ypp @@ -26,6 +26,10 @@ %code requires { +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "s4.hpp" namespace xsk::gsc::s4 { class lexer; } } diff --git a/gen/t6/parser.ypp b/gen/t6/parser.ypp index 39341955..4ce3dcf7 100644 --- a/gen/t6/parser.ypp +++ b/gen/t6/parser.ypp @@ -26,6 +26,10 @@ %code requires { +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "t6.hpp" namespace xsk::arc::t6 { class lexer; } } diff --git a/src/experimental/iw5_console/stdafx.hpp b/src/experimental/iw5_console/stdafx.hpp index fbee26af..19f22f43 100644 --- a/src/experimental/iw5_console/stdafx.hpp +++ b/src/experimental/iw5_console/stdafx.hpp @@ -5,34 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include -// Ext using namespace std::literals; - -#include "xsk/iw5_console.hpp" diff --git a/src/experimental/iw6_console/stdafx.hpp b/src/experimental/iw6_console/stdafx.hpp index f4cfd775..19f22f43 100644 --- a/src/experimental/iw6_console/stdafx.hpp +++ b/src/experimental/iw6_console/stdafx.hpp @@ -5,34 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include -// Ext using namespace std::literals; - -#include "xsk/iw6_console.hpp" diff --git a/src/experimental/s1_console/stdafx.hpp b/src/experimental/s1_console/stdafx.hpp index 428f98d1..19f22f43 100644 --- a/src/experimental/s1_console/stdafx.hpp +++ b/src/experimental/s1_console/stdafx.hpp @@ -5,34 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include -// Ext using namespace std::literals; - -#include "xsk/s1_console.hpp" diff --git a/src/experimental/t4/stdafx.hpp b/src/experimental/t4/stdafx.hpp index 4e9fe7c0..19f22f43 100644 --- a/src/experimental/t4/stdafx.hpp +++ b/src/experimental/t4/stdafx.hpp @@ -5,35 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include -// Ext using namespace std::literals; - -#include "xsk/t4.hpp" diff --git a/src/experimental/t5/stdafx.hpp b/src/experimental/t5/stdafx.hpp index c6450c05..19f22f43 100644 --- a/src/experimental/t5/stdafx.hpp +++ b/src/experimental/t5/stdafx.hpp @@ -5,35 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4005) -#pragma warning(disable:4065) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include -// Ext using namespace std::literals; - -#include "xsk/t5.hpp" diff --git a/src/h1/stdafx.hpp b/src/h1/stdafx.hpp index 1b6ccecf..19f22f43 100644 --- a/src/h1/stdafx.hpp +++ b/src/h1/stdafx.hpp @@ -5,38 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4005) -#pragma warning(disable:4018) -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4389) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include -// Ext using namespace std::literals; - -#include "xsk/h1.hpp" diff --git a/src/h1/xsk/assembler.cpp b/src/h1/xsk/assembler.cpp index 96524282..5018f732 100644 --- a/src/h1/xsk/assembler.cpp +++ b/src/h1/xsk/assembler.cpp @@ -143,7 +143,7 @@ void assembler::assemble_function(const function::ptr& func) func->id = resolver::token_id(func->name); stack_->write(func->size); - stack_->write(func->id); + stack_->write(static_cast(func->id)); if (func->id == 0) { @@ -453,7 +453,7 @@ void assembler::assemble_end_switch(const instruction::ptr& inst) const auto count = std::stoul(inst->data[0]); - script_->write(count); + script_->write(static_cast(count)); std::uint32_t index = inst->index + 3; @@ -520,15 +520,15 @@ void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back if (expr) { - script_->write(addr - inst->index - 3); + script_->write(static_cast(addr - inst->index - 3)); } else if (back) { - script_->write((inst->index + 3) - addr); + script_->write(static_cast((inst->index + 3) - addr)); } else { - script_->write(addr - inst->index - 5); + script_->write(static_cast(addr - inst->index - 5)); } } @@ -547,11 +547,11 @@ void assembler::assemble_offset(std::int32_t offset) auto assembler::resolve_function(const std::string& name) -> std::int32_t { - for (const auto& func : functions_) + for (const auto& entry : functions_) { - if (func->name == name) + if (entry->name == name) { - return func->index; + return entry->index; } } @@ -560,11 +560,11 @@ auto assembler::resolve_function(const std::string& name) -> std::int32_t auto assembler::resolve_label(const std::string& name) -> std::int32_t { - for (const auto& func : labels_) + for (const auto& entry : labels_) { - if (func.second == name) + if (entry.second == name) { - return func.first; + return entry.first; } } diff --git a/src/h1/xsk/compiler.cpp b/src/h1/xsk/compiler.cpp index 7f8122d6..09a62092 100644 --- a/src/h1/xsk/compiler.cpp +++ b/src/h1/xsk/compiler.cpp @@ -848,7 +848,7 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: emit_opcode(opcode::OP_endswitch, data); - auto offset = 7 * stmt->stmt->list.size(); + auto offset = static_cast(7 * stmt->stmt->list.size()); function_->instructions.back()->size += offset; index_ += offset; @@ -2670,7 +2670,7 @@ auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const { if (blk->local_vars.at(i).init) { - return blk->local_vars_create_count - 1 - i; + return static_cast(blk->local_vars_create_count - 1 - i); } throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); diff --git a/src/h1/xsk/decompiler.cpp b/src/h1/xsk/decompiler.cpp index 031e0bab..939172c3 100644 --- a/src/h1/xsk/decompiler.cpp +++ b/src/h1/xsk/decompiler.cpp @@ -1787,7 +1787,7 @@ void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) void decompiler::decompile_infinites(const ast::stmt_list::ptr& stmt) { - for (int i = stmt->list.size() - 1; i >= 0; i--) + for (auto i = stmt->list.size() - 1; i > 0; i--) { if (stmt->list.at(i) == ast::kind::asm_jump_back) { @@ -1950,7 +1950,7 @@ void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) } } -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_end = stmt->list.at(begin).as_cond->value; @@ -1978,7 +1978,7 @@ void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t beg stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.loc_end = stmt->list.at(end).loc().label(); @@ -2029,7 +2029,7 @@ void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.is_last = true; @@ -2089,7 +2089,7 @@ void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uin } } -void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); @@ -2119,7 +2119,7 @@ void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32 stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t start, std::uint32_t end) +void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::size_t start, std::size_t end) { auto& last = block->list.at(end - 1); @@ -2184,7 +2184,7 @@ void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t decompile_while(block, start, end); } -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2214,7 +2214,7 @@ void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2245,7 +2245,7 @@ void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2299,7 +2299,7 @@ void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t be stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2366,7 +2366,7 @@ void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t start) +void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) { block blk; blk.loc_continue = blocks_.back().loc_continue; @@ -2479,7 +2479,7 @@ void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); } -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool +auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool { for (auto i = begin; i < end; i++) { @@ -2498,7 +2498,7 @@ auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::u return false; } -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t +auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t { auto index = 0u; @@ -2516,7 +2516,7 @@ auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std: throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); } -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool +auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool { if (index == stmt->list.size() - 1) return true; @@ -3334,7 +3334,7 @@ void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) { - blk->local_vars_public_count = blk->local_vars.size() - std::stoi(expr->index); + blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); } } // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/decompiler.hpp b/src/h1/xsk/decompiler.hpp index 06d33750..55cf689e 100644 --- a/src/h1/xsk/decompiler.hpp +++ b/src/h1/xsk/decompiler.hpp @@ -34,19 +34,19 @@ private: void decompile_switches(const ast::stmt_list::ptr& stmt); void decompile_ifelses(const ast::stmt_list::ptr& stmt); void decompile_aborts(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool; + void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); + auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; + auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; + auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; void process_stack(const ast::decl_thread::ptr& thread); void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); void process_stmt(const ast::stmt& stmt, const block::ptr& blk); diff --git a/src/h1/xsk/disassembler.cpp b/src/h1/xsk/disassembler.cpp index 6df661ea..d5dd84d7 100644 --- a/src/h1/xsk/disassembler.cpp +++ b/src/h1/xsk/disassembler.cpp @@ -51,7 +51,7 @@ void disassembler::disassemble(const std::string& file, std::vectorindex = static_cast(script_->pos()); func->size = stack_->read(); func->id = stack_->read(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id); + func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); dissasemble_function(func); diff --git a/src/h1/xsk/lexer.cpp b/src/h1/xsk/lexer.cpp index 6702da5c..4443b23d 100644 --- a/src/h1/xsk/lexer.cpp +++ b/src/h1/xsk/lexer.cpp @@ -97,7 +97,7 @@ void reader::init(const char* data, size_t size) { state = reader::ok; buffer_pos = data; - bytes_remaining = size; + bytes_remaining = static_cast(size); last_byte = 0; current_byte = *data; } diff --git a/src/h1/xsk/parser.cpp b/src/h1/xsk/parser.cpp index 6b5dc435..3af04927 100644 --- a/src/h1/xsk/parser.cpp +++ b/src/h1/xsk/parser.cpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -35,7 +35,7 @@ // private implementation details that can be changed or removed. // "%code top" blocks. -#line 36 "parser.ypp" +#line 38 "parser.ypp" #include "stdafx.hpp" #include "parser.hpp" @@ -166,9 +166,9 @@ namespace xsk { namespace gsc { namespace h1 { parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -1467,7 +1467,7 @@ namespace xsk { namespace gsc { namespace h1 { } void - parser::yypop_ (int n) + parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -1510,13 +1510,13 @@ namespace xsk { namespace gsc { namespace h1 { } bool - parser::yy_pact_value_is_default_ (int yyvalue) + parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - parser::yy_table_value_is_error_ (int yyvalue) + parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -1547,8 +1547,8 @@ namespace xsk { namespace gsc { namespace h1 { /// The return value of parse (). int yyresult; - /// Discard the LAC context in case there still is one left from a - /// previous invocation. + // Discard the LAC context in case there still is one left from a + // previous invocation. yy_lac_discard_ ("init"); #if YY_EXCEPTIONS @@ -1626,7 +1626,7 @@ namespace xsk { namespace gsc { namespace h1 { if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) { if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; goto yydefault; } @@ -1637,7 +1637,7 @@ namespace xsk { namespace gsc { namespace h1 { if (yy_table_value_is_error_ (yyn)) goto yyerrlab; if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -1984,1315 +1984,1315 @@ namespace xsk { namespace gsc { namespace h1 { switch (yyn) { case 2: // root: program -#line 257 "parser.ypp" +#line 259 "parser.ypp" { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } #line 1990 "parser.cpp" break; case 3: // root: %empty -#line 258 "parser.ypp" +#line 260 "parser.ypp" { ast = std::make_unique(yylhs.location); } #line 1996 "parser.cpp" break; case 4: // program: program inline -#line 263 "parser.ypp" +#line 265 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } #line 2002 "parser.cpp" break; case 5: // program: program include -#line 265 "parser.ypp" +#line 267 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2008 "parser.cpp" break; case 6: // program: program declaration -#line 267 "parser.ypp" +#line 269 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2014 "parser.cpp" break; case 7: // program: inline -#line 269 "parser.ypp" +#line 271 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } #line 2020 "parser.cpp" break; case 8: // program: include -#line 271 "parser.ypp" +#line 273 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2026 "parser.cpp" break; case 9: // program: declaration -#line 273 "parser.ypp" +#line 275 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2032 "parser.cpp" break; case 10: // inline: "#inline" expr_path ";" -#line 277 "parser.ypp" +#line 279 "parser.ypp" { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } #line 2038 "parser.cpp" break; case 11: // include: "#include" expr_path ";" -#line 282 "parser.ypp" +#line 284 "parser.ypp" { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } #line 2044 "parser.cpp" break; case 12: // declaration: "/#" -#line 286 "parser.ypp" +#line 288 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } #line 2050 "parser.cpp" break; case 13: // declaration: "#/" -#line 287 "parser.ypp" +#line 289 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } #line 2056 "parser.cpp" break; case 14: // declaration: decl_usingtree -#line 288 "parser.ypp" +#line 290 "parser.ypp" { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } #line 2062 "parser.cpp" break; case 15: // declaration: decl_constant -#line 289 "parser.ypp" +#line 291 "parser.ypp" { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } #line 2068 "parser.cpp" break; case 16: // declaration: decl_thread -#line 290 "parser.ypp" +#line 292 "parser.ypp" { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } #line 2074 "parser.cpp" break; case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 295 "parser.ypp" +#line 297 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_usingtree::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_string::ptr > ())); } #line 2080 "parser.cpp" break; case 18: // decl_constant: expr_identifier "=" expr ";" -#line 300 "parser.ypp" +#line 302 "parser.ypp" { yylhs.value.as < ast::decl_constant::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 2086 "parser.cpp" break; case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 305 "parser.ypp" +#line 307 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2092 "parser.cpp" break; case 20: // stmt: stmt_block -#line 309 "parser.ypp" +#line 311 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } #line 2098 "parser.cpp" break; case 21: // stmt: stmt_call -#line 310 "parser.ypp" +#line 312 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } #line 2104 "parser.cpp" break; case 22: // stmt: stmt_assign -#line 311 "parser.ypp" +#line 313 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } #line 2110 "parser.cpp" break; case 23: // stmt: stmt_endon -#line 312 "parser.ypp" +#line 314 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } #line 2116 "parser.cpp" break; case 24: // stmt: stmt_notify -#line 313 "parser.ypp" +#line 315 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } #line 2122 "parser.cpp" break; case 25: // stmt: stmt_wait -#line 314 "parser.ypp" +#line 316 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } #line 2128 "parser.cpp" break; case 26: // stmt: stmt_waittill -#line 315 "parser.ypp" +#line 317 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } #line 2134 "parser.cpp" break; case 27: // stmt: stmt_waittillmatch -#line 316 "parser.ypp" +#line 318 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } #line 2140 "parser.cpp" break; case 28: // stmt: stmt_waittillframeend -#line 317 "parser.ypp" +#line 319 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } #line 2146 "parser.cpp" break; case 29: // stmt: stmt_waitframe -#line 318 "parser.ypp" +#line 320 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waitframe = std::move(yystack_[0].value.as < ast::stmt_waitframe::ptr > ()); } #line 2152 "parser.cpp" break; case 30: // stmt: stmt_if -#line 319 "parser.ypp" +#line 321 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } #line 2158 "parser.cpp" break; case 31: // stmt: stmt_ifelse -#line 320 "parser.ypp" +#line 322 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } #line 2164 "parser.cpp" break; case 32: // stmt: stmt_while -#line 321 "parser.ypp" +#line 323 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } #line 2170 "parser.cpp" break; case 33: // stmt: stmt_dowhile -#line 322 "parser.ypp" +#line 324 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } #line 2176 "parser.cpp" break; case 34: // stmt: stmt_for -#line 323 "parser.ypp" +#line 325 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } #line 2182 "parser.cpp" break; case 35: // stmt: stmt_foreach -#line 324 "parser.ypp" +#line 326 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } #line 2188 "parser.cpp" break; case 36: // stmt: stmt_switch -#line 325 "parser.ypp" +#line 327 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } #line 2194 "parser.cpp" break; case 37: // stmt: stmt_case -#line 326 "parser.ypp" +#line 328 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } #line 2200 "parser.cpp" break; case 38: // stmt: stmt_default -#line 327 "parser.ypp" +#line 329 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } #line 2206 "parser.cpp" break; case 39: // stmt: stmt_break -#line 328 "parser.ypp" +#line 330 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } #line 2212 "parser.cpp" break; case 40: // stmt: stmt_continue -#line 329 "parser.ypp" +#line 331 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } #line 2218 "parser.cpp" break; case 41: // stmt: stmt_return -#line 330 "parser.ypp" +#line 332 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } #line 2224 "parser.cpp" break; case 42: // stmt: stmt_breakpoint -#line 331 "parser.ypp" +#line 333 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } #line 2230 "parser.cpp" break; case 43: // stmt: stmt_prof_begin -#line 332 "parser.ypp" +#line 334 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } #line 2236 "parser.cpp" break; case 44: // stmt: stmt_prof_end -#line 333 "parser.ypp" +#line 335 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } #line 2242 "parser.cpp" break; case 45: // stmt_or_dev: stmt -#line 337 "parser.ypp" +#line 339 "parser.ypp" { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } #line 2248 "parser.cpp" break; case 46: // stmt_or_dev: stmt_dev -#line 338 "parser.ypp" +#line 340 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } #line 2254 "parser.cpp" break; case 47: // stmt_list: stmt_list stmt -#line 343 "parser.ypp" +#line 345 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2260 "parser.cpp" break; case 48: // stmt_list: stmt -#line 345 "parser.ypp" +#line 347 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2266 "parser.cpp" break; case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 350 "parser.ypp" +#line 352 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2272 "parser.cpp" break; case 50: // stmt_or_dev_list: stmt_or_dev -#line 352 "parser.ypp" +#line 354 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2278 "parser.cpp" break; case 51: // stmt_dev: "/#" stmt_list "#/" -#line 356 "parser.ypp" +#line 358 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::stmt_list::ptr > ())); } #line 2284 "parser.cpp" break; case 52: // stmt_dev: "/#" "#/" -#line 357 "parser.ypp" +#line 359 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2290 "parser.cpp" break; case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 361 "parser.ypp" +#line 363 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } #line 2296 "parser.cpp" break; case 54: // stmt_block: "{" "}" -#line 362 "parser.ypp" +#line 364 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } #line 2302 "parser.cpp" break; case 55: // stmt_expr: expr_assign -#line 367 "parser.ypp" +#line 369 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2308 "parser.cpp" break; case 56: // stmt_expr: expr_increment -#line 369 "parser.ypp" +#line 371 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2314 "parser.cpp" break; case 57: // stmt_expr: expr_decrement -#line 371 "parser.ypp" +#line 373 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2320 "parser.cpp" break; case 58: // stmt_expr: %empty -#line 373 "parser.ypp" +#line 375 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2326 "parser.cpp" break; case 59: // stmt_call: expr_call ";" -#line 378 "parser.ypp" +#line 380 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_call::ptr > ()))); } #line 2332 "parser.cpp" break; case 60: // stmt_call: expr_method ";" -#line 380 "parser.ypp" +#line 382 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_method::ptr > ()))); } #line 2338 "parser.cpp" break; case 61: // stmt_assign: expr_assign ";" -#line 385 "parser.ypp" +#line 387 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2344 "parser.cpp" break; case 62: // stmt_assign: expr_increment ";" -#line 387 "parser.ypp" +#line 389 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2350 "parser.cpp" break; case 63: // stmt_assign: expr_decrement ";" -#line 389 "parser.ypp" +#line 391 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2356 "parser.cpp" break; case 64: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 394 "parser.ypp" +#line 396 "parser.ypp" { yylhs.value.as < ast::stmt_endon::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ())); } #line 2362 "parser.cpp" break; case 65: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 399 "parser.ypp" +#line 401 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2368 "parser.cpp" break; case 66: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 401 "parser.ypp" +#line 403 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2374 "parser.cpp" break; case 67: // stmt_wait: "wait" expr ";" -#line 406 "parser.ypp" +#line 408 "parser.ypp" { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2380 "parser.cpp" break; case 68: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 411 "parser.ypp" +#line 413 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2386 "parser.cpp" break; case 69: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 413 "parser.ypp" +#line 415 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2392 "parser.cpp" break; case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 418 "parser.ypp" +#line 420 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2398 "parser.cpp" break; case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 420 "parser.ypp" +#line 422 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2404 "parser.cpp" break; case 72: // stmt_waittillframeend: "waittillframeend" ";" -#line 425 "parser.ypp" +#line 427 "parser.ypp" { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } #line 2410 "parser.cpp" break; case 73: // stmt_waitframe: "waitframe" ";" -#line 430 "parser.ypp" +#line 432 "parser.ypp" { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } #line 2416 "parser.cpp" break; case 74: // stmt_waitframe: "waitframe" "(" ")" ";" -#line 432 "parser.ypp" +#line 434 "parser.ypp" { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } #line 2422 "parser.cpp" break; case 75: // stmt_if: "if" "(" expr ")" stmt -#line 437 "parser.ypp" +#line 439 "parser.ypp" { yylhs.value.as < ast::stmt_if::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2428 "parser.cpp" break; case 76: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 442 "parser.ypp" +#line 444 "parser.ypp" { yylhs.value.as < ast::stmt_ifelse::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::stmt > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2434 "parser.cpp" break; case 77: // stmt_while: "while" "(" expr ")" stmt -#line 447 "parser.ypp" +#line 449 "parser.ypp" { yylhs.value.as < ast::stmt_while::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2440 "parser.cpp" break; case 78: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 452 "parser.ypp" +#line 454 "parser.ypp" { yylhs.value.as < ast::stmt_dowhile::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[5].value.as < ast::stmt > ())); } #line 2446 "parser.cpp" break; case 79: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 457 "parser.ypp" +#line 459 "parser.ypp" { yylhs.value.as < ast::stmt_for::ptr > () = std::make_unique(yylhs.location, ast::stmt(std::move(yystack_[6].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[4].value.as < ast::expr > ()), ast::stmt(std::move(yystack_[2].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2452 "parser.cpp" break; case 80: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 462 "parser.ypp" +#line 464 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2458 "parser.cpp" break; case 81: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 464 "parser.ypp" +#line 466 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[6].value.as < ast::expr_identifier::ptr > ())), ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2464 "parser.cpp" break; case 82: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 469 "parser.ypp" +#line 471 "parser.ypp" { yylhs.value.as < ast::stmt_switch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2470 "parser.cpp" break; case 83: // stmt_case: "case" expr_integer ":" -#line 474 "parser.ypp" +#line 476 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_integer::ptr > ())), std::make_unique(yylhs.location)); } #line 2476 "parser.cpp" break; case 84: // stmt_case: "case" expr_string ":" -#line 476 "parser.ypp" +#line 478 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_string::ptr > ())), std::make_unique(yylhs.location)); } #line 2482 "parser.cpp" break; case 85: // stmt_default: "default" ":" -#line 481 "parser.ypp" +#line 483 "parser.ypp" { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2488 "parser.cpp" break; case 86: // stmt_break: "break" ";" -#line 486 "parser.ypp" +#line 488 "parser.ypp" { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } #line 2494 "parser.cpp" break; case 87: // stmt_continue: "continue" ";" -#line 491 "parser.ypp" +#line 493 "parser.ypp" { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } #line 2500 "parser.cpp" break; case 88: // stmt_return: "return" expr ";" -#line 496 "parser.ypp" +#line 498 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2506 "parser.cpp" break; case 89: // stmt_return: "return" ";" -#line 498 "parser.ypp" +#line 500 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2512 "parser.cpp" break; case 90: // stmt_breakpoint: "breakpoint" ";" -#line 503 "parser.ypp" +#line 505 "parser.ypp" { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } #line 2518 "parser.cpp" break; case 91: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 508 "parser.ypp" +#line 510 "parser.ypp" { yylhs.value.as < ast::stmt_prof_begin::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2524 "parser.cpp" break; case 92: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 513 "parser.ypp" +#line 515 "parser.ypp" { yylhs.value.as < ast::stmt_prof_end::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2530 "parser.cpp" break; case 93: // expr: expr_ternary -#line 517 "parser.ypp" +#line 519 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2536 "parser.cpp" break; case 94: // expr: expr_binary -#line 518 "parser.ypp" +#line 520 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2542 "parser.cpp" break; case 95: // expr: expr_primitive -#line 519 "parser.ypp" +#line 521 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2548 "parser.cpp" break; case 96: // expr_or_empty: expr -#line 523 "parser.ypp" +#line 525 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2554 "parser.cpp" break; case 97: // expr_or_empty: %empty -#line 524 "parser.ypp" +#line 526 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } #line 2560 "parser.cpp" break; case 98: // expr_assign: expr_object "=" expr -#line 529 "parser.ypp" +#line 531 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2566 "parser.cpp" break; case 99: // expr_assign: expr_object "|=" expr -#line 531 "parser.ypp" +#line 533 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2572 "parser.cpp" break; case 100: // expr_assign: expr_object "&=" expr -#line 533 "parser.ypp" +#line 535 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2578 "parser.cpp" break; case 101: // expr_assign: expr_object "^=" expr -#line 535 "parser.ypp" +#line 537 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2584 "parser.cpp" break; case 102: // expr_assign: expr_object "<<=" expr -#line 537 "parser.ypp" +#line 539 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()),std::move( yystack_[0].value.as < ast::expr > ())); } #line 2590 "parser.cpp" break; case 103: // expr_assign: expr_object ">>=" expr -#line 539 "parser.ypp" +#line 541 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2596 "parser.cpp" break; case 104: // expr_assign: expr_object "+=" expr -#line 541 "parser.ypp" +#line 543 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2602 "parser.cpp" break; case 105: // expr_assign: expr_object "-=" expr -#line 543 "parser.ypp" +#line 545 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2608 "parser.cpp" break; case 106: // expr_assign: expr_object "*=" expr -#line 545 "parser.ypp" +#line 547 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2614 "parser.cpp" break; case 107: // expr_assign: expr_object "/=" expr -#line 547 "parser.ypp" +#line 549 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2620 "parser.cpp" break; case 108: // expr_assign: expr_object "%=" expr -#line 549 "parser.ypp" +#line 551 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2626 "parser.cpp" break; case 109: // expr_increment: "++" expr_object -#line 554 "parser.ypp" +#line 556 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2632 "parser.cpp" break; case 110: // expr_increment: expr_object "++" -#line 556 "parser.ypp" +#line 558 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2638 "parser.cpp" break; case 111: // expr_decrement: "--" expr_object -#line 561 "parser.ypp" +#line 563 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2644 "parser.cpp" break; case 112: // expr_decrement: expr_object "--" -#line 563 "parser.ypp" +#line 565 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2650 "parser.cpp" break; case 113: // expr_ternary: expr "?" expr ":" expr -#line 568 "parser.ypp" +#line 570 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2656 "parser.cpp" break; case 114: // expr_binary: expr "||" expr -#line 573 "parser.ypp" +#line 575 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2662 "parser.cpp" break; case 115: // expr_binary: expr "&&" expr -#line 575 "parser.ypp" +#line 577 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2668 "parser.cpp" break; case 116: // expr_binary: expr "==" expr -#line 577 "parser.ypp" +#line 579 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2674 "parser.cpp" break; case 117: // expr_binary: expr "!=" expr -#line 579 "parser.ypp" +#line 581 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2680 "parser.cpp" break; case 118: // expr_binary: expr "<=" expr -#line 581 "parser.ypp" +#line 583 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2686 "parser.cpp" break; case 119: // expr_binary: expr ">=" expr -#line 583 "parser.ypp" +#line 585 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2692 "parser.cpp" break; case 120: // expr_binary: expr "<" expr -#line 585 "parser.ypp" +#line 587 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2698 "parser.cpp" break; case 121: // expr_binary: expr ">" expr -#line 587 "parser.ypp" +#line 589 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2704 "parser.cpp" break; case 122: // expr_binary: expr "|" expr -#line 589 "parser.ypp" +#line 591 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2710 "parser.cpp" break; case 123: // expr_binary: expr "&" expr -#line 591 "parser.ypp" +#line 593 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2716 "parser.cpp" break; case 124: // expr_binary: expr "^" expr -#line 593 "parser.ypp" +#line 595 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2722 "parser.cpp" break; case 125: // expr_binary: expr "<<" expr -#line 595 "parser.ypp" +#line 597 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2728 "parser.cpp" break; case 126: // expr_binary: expr ">>" expr -#line 597 "parser.ypp" +#line 599 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2734 "parser.cpp" break; case 127: // expr_binary: expr "+" expr -#line 599 "parser.ypp" +#line 601 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2740 "parser.cpp" break; case 128: // expr_binary: expr "-" expr -#line 601 "parser.ypp" +#line 603 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2746 "parser.cpp" break; case 129: // expr_binary: expr "*" expr -#line 603 "parser.ypp" +#line 605 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2752 "parser.cpp" break; case 130: // expr_binary: expr "/" expr -#line 605 "parser.ypp" +#line 607 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2758 "parser.cpp" break; case 131: // expr_binary: expr "%" expr -#line 607 "parser.ypp" +#line 609 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2764 "parser.cpp" break; case 132: // expr_primitive: expr_complement -#line 611 "parser.ypp" +#line 613 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } #line 2770 "parser.cpp" break; case 133: // expr_primitive: expr_not -#line 612 "parser.ypp" +#line 614 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } #line 2776 "parser.cpp" break; case 134: // expr_primitive: expr_call -#line 613 "parser.ypp" +#line 615 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 2782 "parser.cpp" break; case 135: // expr_primitive: expr_method -#line 614 "parser.ypp" +#line 616 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 2788 "parser.cpp" break; case 136: // expr_primitive: expr_add_array -#line 615 "parser.ypp" +#line 617 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } #line 2794 "parser.cpp" break; case 137: // expr_primitive: expr_reference -#line 616 "parser.ypp" +#line 618 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } #line 2800 "parser.cpp" break; case 138: // expr_primitive: expr_array -#line 617 "parser.ypp" +#line 619 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 2806 "parser.cpp" break; case 139: // expr_primitive: expr_field -#line 618 "parser.ypp" +#line 620 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 2812 "parser.cpp" break; case 140: // expr_primitive: expr_size -#line 619 "parser.ypp" +#line 621 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } #line 2818 "parser.cpp" break; case 141: // expr_primitive: expr_paren -#line 620 "parser.ypp" +#line 622 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } #line 2824 "parser.cpp" break; case 142: // expr_primitive: expr_thisthread -#line 621 "parser.ypp" +#line 623 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } #line 2830 "parser.cpp" break; case 143: // expr_primitive: expr_empty_array -#line 622 "parser.ypp" +#line 624 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } #line 2836 "parser.cpp" break; case 144: // expr_primitive: expr_undefined -#line 623 "parser.ypp" +#line 625 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } #line 2842 "parser.cpp" break; case 145: // expr_primitive: expr_game -#line 624 "parser.ypp" +#line 626 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 2848 "parser.cpp" break; case 146: // expr_primitive: expr_self -#line 625 "parser.ypp" +#line 627 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 2854 "parser.cpp" break; case 147: // expr_primitive: expr_anim -#line 626 "parser.ypp" +#line 628 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 2860 "parser.cpp" break; case 148: // expr_primitive: expr_level -#line 627 "parser.ypp" +#line 629 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 2866 "parser.cpp" break; case 149: // expr_primitive: expr_animation -#line 628 "parser.ypp" +#line 630 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } #line 2872 "parser.cpp" break; case 150: // expr_primitive: expr_animtree -#line 629 "parser.ypp" +#line 631 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } #line 2878 "parser.cpp" break; case 151: // expr_primitive: expr_identifier -#line 630 "parser.ypp" +#line 632 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 2884 "parser.cpp" break; case 152: // expr_primitive: expr_istring -#line 631 "parser.ypp" +#line 633 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } #line 2890 "parser.cpp" break; case 153: // expr_primitive: expr_string -#line 632 "parser.ypp" +#line 634 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } #line 2896 "parser.cpp" break; case 154: // expr_primitive: expr_vector -#line 633 "parser.ypp" +#line 635 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } #line 2902 "parser.cpp" break; case 155: // expr_primitive: expr_float -#line 634 "parser.ypp" +#line 636 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } #line 2908 "parser.cpp" break; case 156: // expr_primitive: expr_integer -#line 635 "parser.ypp" +#line 637 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } #line 2914 "parser.cpp" break; case 157: // expr_primitive: expr_false -#line 636 "parser.ypp" +#line 638 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } #line 2920 "parser.cpp" break; case 158: // expr_primitive: expr_true -#line 637 "parser.ypp" +#line 639 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } #line 2926 "parser.cpp" break; case 159: // expr_complement: "~" expr -#line 642 "parser.ypp" +#line 644 "parser.ypp" { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2932 "parser.cpp" break; case 160: // expr_not: "!" expr -#line 647 "parser.ypp" +#line 649 "parser.ypp" { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2938 "parser.cpp" break; case 161: // expr_call: expr_function -#line 651 "parser.ypp" +#line 653 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2944 "parser.cpp" break; case 162: // expr_call: expr_pointer -#line 652 "parser.ypp" +#line 654 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2950 "parser.cpp" break; case 163: // expr_method: expr_object expr_function -#line 655 "parser.ypp" +#line 657 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 2956 "parser.cpp" break; case 164: // expr_method: expr_object expr_pointer -#line 656 "parser.ypp" +#line 658 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 2962 "parser.cpp" break; case 165: // expr_function: expr_identifier "(" expr_arguments ")" -#line 661 "parser.ypp" +#line 663 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2968 "parser.cpp" break; case 166: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 663 "parser.ypp" +#line 665 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2974 "parser.cpp" break; case 167: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 665 "parser.ypp" +#line 667 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2980 "parser.cpp" break; case 168: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 667 "parser.ypp" +#line 669 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2986 "parser.cpp" break; case 169: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 669 "parser.ypp" +#line 671 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2992 "parser.cpp" break; case 170: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 671 "parser.ypp" +#line 673 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2998 "parser.cpp" break; case 171: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 676 "parser.ypp" +#line 678 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3004 "parser.cpp" break; case 172: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 678 "parser.ypp" +#line 680 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3010 "parser.cpp" break; case 173: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 680 "parser.ypp" +#line 682 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 3016 "parser.cpp" break; case 174: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 682 "parser.ypp" +#line 684 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::builtin); } #line 3022 "parser.cpp" break; case 175: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 687 "parser.ypp" +#line 689 "parser.ypp" { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } #line 3028 "parser.cpp" break; case 176: // expr_parameters: expr_parameters "," expr_identifier -#line 692 "parser.ypp" +#line 694 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3034 "parser.cpp" break; case 177: // expr_parameters: expr_identifier -#line 694 "parser.ypp" +#line 696 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3040 "parser.cpp" break; case 178: // expr_parameters: %empty -#line 696 "parser.ypp" +#line 698 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } #line 3046 "parser.cpp" break; case 179: // expr_arguments: expr_arguments_no_empty -#line 701 "parser.ypp" +#line 703 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } #line 3052 "parser.cpp" break; case 180: // expr_arguments: %empty -#line 703 "parser.ypp" +#line 705 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } #line 3058 "parser.cpp" break; case 181: // expr_arguments_no_empty: expr_arguments "," expr -#line 708 "parser.ypp" +#line 710 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ()); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3064 "parser.cpp" break; case 182: // expr_arguments_no_empty: expr -#line 710 "parser.ypp" +#line 712 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3070 "parser.cpp" break; case 183: // expr_reference: "::" expr_identifier -#line 715 "parser.ypp" +#line 717 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3076 "parser.cpp" break; case 184: // expr_reference: expr_path "::" expr_identifier -#line 717 "parser.ypp" +#line 719 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_path::ptr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3082 "parser.cpp" break; case 185: // expr_array: expr_object "[" expr "]" -#line 722 "parser.ypp" +#line 724 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3088 "parser.cpp" break; case 186: // expr_field: expr_object "." expr_identifier_nosize -#line 727 "parser.ypp" +#line 729 "parser.ypp" { yylhs.value.as < ast::expr_field::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3094 "parser.cpp" break; case 187: // expr_size: expr_object "." "size" -#line 732 "parser.ypp" +#line 734 "parser.ypp" { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } #line 3100 "parser.cpp" break; case 188: // expr_paren: "(" expr ")" -#line 737 "parser.ypp" +#line 739 "parser.ypp" { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3106 "parser.cpp" break; case 189: // expr_object: expr_call -#line 741 "parser.ypp" +#line 743 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 3112 "parser.cpp" break; case 190: // expr_object: expr_method -#line 742 "parser.ypp" +#line 744 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 3118 "parser.cpp" break; case 191: // expr_object: expr_array -#line 743 "parser.ypp" +#line 745 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 3124 "parser.cpp" break; case 192: // expr_object: expr_field -#line 744 "parser.ypp" +#line 746 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 3130 "parser.cpp" break; case 193: // expr_object: expr_game -#line 745 "parser.ypp" +#line 747 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 3136 "parser.cpp" break; case 194: // expr_object: expr_self -#line 746 "parser.ypp" +#line 748 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 3142 "parser.cpp" break; case 195: // expr_object: expr_anim -#line 747 "parser.ypp" +#line 749 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 3148 "parser.cpp" break; case 196: // expr_object: expr_level -#line 748 "parser.ypp" +#line 750 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 3154 "parser.cpp" break; case 197: // expr_object: expr_identifier -#line 749 "parser.ypp" +#line 751 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 3160 "parser.cpp" break; case 198: // expr_thisthread: "thisthread" -#line 754 "parser.ypp" +#line 756 "parser.ypp" { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } #line 3166 "parser.cpp" break; case 199: // expr_empty_array: "[" "]" -#line 759 "parser.ypp" +#line 761 "parser.ypp" { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } #line 3172 "parser.cpp" break; case 200: // expr_undefined: "undefined" -#line 764 "parser.ypp" +#line 766 "parser.ypp" { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } #line 3178 "parser.cpp" break; case 201: // expr_game: "game" -#line 769 "parser.ypp" +#line 771 "parser.ypp" { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } #line 3184 "parser.cpp" break; case 202: // expr_self: "self" -#line 774 "parser.ypp" +#line 776 "parser.ypp" { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } #line 3190 "parser.cpp" break; case 203: // expr_anim: "anim" -#line 779 "parser.ypp" +#line 781 "parser.ypp" { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } #line 3196 "parser.cpp" break; case 204: // expr_level: "level" -#line 784 "parser.ypp" +#line 786 "parser.ypp" { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } #line 3202 "parser.cpp" break; case 205: // expr_animation: "%" "identifier" -#line 789 "parser.ypp" +#line 791 "parser.ypp" { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3208 "parser.cpp" break; case 206: // expr_animtree: "#animtree" -#line 794 "parser.ypp" +#line 796 "parser.ypp" { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } #line 3214 "parser.cpp" break; case 207: // expr_identifier_nosize: "identifier" -#line 799 "parser.ypp" +#line 801 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3220 "parser.cpp" break; case 208: // expr_identifier: "identifier" -#line 804 "parser.ypp" +#line 806 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3226 "parser.cpp" break; case 209: // expr_identifier: "size" -#line 806 "parser.ypp" +#line 808 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } #line 3232 "parser.cpp" break; case 210: // expr_path: "identifier" -#line 811 "parser.ypp" +#line 813 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3238 "parser.cpp" break; case 211: // expr_path: "path" -#line 813 "parser.ypp" +#line 815 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3244 "parser.cpp" break; case 212: // expr_istring: "localized string" -#line 818 "parser.ypp" +#line 820 "parser.ypp" { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3250 "parser.cpp" break; case 213: // expr_string: "string literal" -#line 823 "parser.ypp" +#line 825 "parser.ypp" { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3256 "parser.cpp" break; case 214: // expr_vector: "(" expr "," expr "," expr ")" -#line 828 "parser.ypp" +#line 830 "parser.ypp" { yylhs.value.as < ast::expr_vector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3262 "parser.cpp" break; case 215: // expr_float: "-" "float" -#line 833 "parser.ypp" +#line 835 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3268 "parser.cpp" break; case 216: // expr_float: "float" -#line 835 "parser.ypp" +#line 837 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3274 "parser.cpp" break; case 217: // expr_integer: "-" "integer" -#line 840 "parser.ypp" +#line 842 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3280 "parser.cpp" break; case 218: // expr_integer: "integer" -#line 842 "parser.ypp" +#line 844 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3286 "parser.cpp" break; case 219: // expr_false: "false" -#line 847 "parser.ypp" +#line 849 "parser.ypp" { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } #line 3292 "parser.cpp" break; case 220: // expr_true: "true" -#line 852 "parser.ypp" +#line 854 "parser.ypp" { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } #line 3298 "parser.cpp" break; @@ -3562,6 +3562,8 @@ namespace xsk { namespace gsc { namespace h1 { } + + bool parser::yy_lac_check_ (symbol_kind_type yytoken) const { @@ -3666,7 +3668,9 @@ namespace xsk { namespace gsc { namespace h1 { follows. If no initial context is currently established for the current lookahead, then check if that lookahead can eventually be shifted if syntactic actions continue from the current context. */ - if (!yy_lac_established_) + if (yy_lac_established_) + return true; + else { #if H1DEBUG YYCDEBUG << "LAC: initial context established for " @@ -3675,12 +3679,11 @@ namespace xsk { namespace gsc { namespace h1 { yy_lac_established_ = true; return yy_lac_check_ (yytoken); } - return true; } // Discard any previous initial lookahead context. void - parser::yy_lac_discard_ (const char* evt) + parser::yy_lac_discard_ (const char* event) { /* Discard any previous initial lookahead context because of Event, which may be a lookahead change or an invalidation of the currently @@ -3696,11 +3699,12 @@ namespace xsk { namespace gsc { namespace h1 { if (yy_lac_established_) { YYCDEBUG << "LAC: initial context discarded due to " - << evt << '\n'; + << event << '\n'; yy_lac_established_ = false; } } + int parser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -4487,29 +4491,29 @@ namespace xsk { namespace gsc { namespace h1 { const short parser::yyrline_[] = { - 0, 257, 257, 258, 262, 264, 266, 268, 270, 272, - 277, 281, 286, 287, 288, 289, 290, 294, 299, 304, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 337, 338, 342, 344, 349, - 351, 356, 357, 361, 362, 366, 368, 370, 373, 377, - 379, 384, 386, 388, 393, 398, 400, 405, 410, 412, - 417, 419, 424, 429, 431, 436, 441, 446, 451, 456, - 461, 463, 468, 473, 475, 480, 485, 490, 495, 497, - 502, 507, 512, 517, 518, 519, 523, 524, 528, 530, - 532, 534, 536, 538, 540, 542, 544, 546, 548, 553, - 555, 560, 562, 567, 572, 574, 576, 578, 580, 582, - 584, 586, 588, 590, 592, 594, 596, 598, 600, 602, - 604, 606, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, - 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, - 646, 651, 652, 655, 656, 660, 662, 664, 666, 668, - 670, 675, 677, 679, 681, 686, 691, 693, 696, 700, - 703, 707, 709, 714, 716, 721, 726, 731, 736, 741, - 742, 743, 744, 745, 746, 747, 748, 749, 753, 758, - 763, 768, 773, 778, 783, 788, 793, 798, 803, 805, - 810, 812, 817, 822, 827, 832, 834, 839, 841, 846, - 851 + 0, 259, 259, 260, 264, 266, 268, 270, 272, 274, + 279, 283, 288, 289, 290, 291, 292, 296, 301, 306, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 339, 340, 344, 346, 351, + 353, 358, 359, 363, 364, 368, 370, 372, 375, 379, + 381, 386, 388, 390, 395, 400, 402, 407, 412, 414, + 419, 421, 426, 431, 433, 438, 443, 448, 453, 458, + 463, 465, 470, 475, 477, 482, 487, 492, 497, 499, + 504, 509, 514, 519, 520, 521, 525, 526, 530, 532, + 534, 536, 538, 540, 542, 544, 546, 548, 550, 555, + 557, 562, 564, 569, 574, 576, 578, 580, 582, 584, + 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, + 606, 608, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 643, + 648, 653, 654, 657, 658, 662, 664, 666, 668, 670, + 672, 677, 679, 681, 683, 688, 693, 695, 698, 702, + 705, 709, 711, 716, 718, 723, 728, 733, 738, 743, + 744, 745, 746, 747, 748, 749, 750, 751, 755, 760, + 765, 770, 775, 780, 785, 790, 795, 800, 805, 807, + 812, 814, 819, 824, 829, 834, 836, 841, 843, 848, + 853 }; void @@ -4542,9 +4546,9 @@ namespace xsk { namespace gsc { namespace h1 { #line 13 "parser.ypp" } } } // xsk::gsc::h1 -#line 4546 "parser.cpp" +#line 4550 "parser.cpp" -#line 855 "parser.ypp" +#line 857 "parser.ypp" void xsk::gsc::h1::parser::error(const xsk::gsc::location& loc, const std::string& msg) diff --git a/src/h1/xsk/parser.hpp b/src/h1/xsk/parser.hpp index 5d761848..139436cb 100644 --- a/src/h1/xsk/parser.hpp +++ b/src/h1/xsk/parser.hpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -47,12 +47,14 @@ // "%code requires" blocks. #line 28 "parser.ypp" +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "h1.hpp" namespace xsk::gsc::h1 { class lexer; } -typedef void *yyscan_t; -#define YY_DECL xsk::gsc::h1::parser::symbol_type yylex(yyscan_t yyscanner, xsk::gsc::location& loc) -#line 56 "parser.hpp" +#line 58 "parser.hpp" # include # include // std::abort @@ -128,12 +130,18 @@ typedef void *yyscan_t; # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -195,7 +203,7 @@ typedef void *yyscan_t; #line 13 "parser.ypp" namespace xsk { namespace gsc { namespace h1 { -#line 199 "parser.hpp" +#line 207 "parser.hpp" @@ -204,27 +212,32 @@ namespace xsk { namespace gsc { namespace h1 { class parser { public: -#ifndef H1STYPE +#ifdef H1STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define H1STYPE in C++, use %define api.value.type" +# endif + typedef H1STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { H1_ASSERT (sizeof (T) <= size); @@ -233,13 +246,13 @@ namespace xsk { namespace gsc { namespace h1 { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { H1_ASSERT (!yytypeid_); } @@ -383,7 +396,7 @@ namespace xsk { namespace gsc { namespace h1 { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -393,7 +406,7 @@ namespace xsk { namespace gsc { namespace h1 { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -402,7 +415,7 @@ namespace xsk { namespace gsc { namespace h1 { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -637,18 +650,19 @@ namespace xsk { namespace gsc { namespace h1 { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef H1STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef xsk::gsc::location location_type; @@ -795,7 +809,7 @@ namespace xsk { namespace gsc { namespace h1 { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -1025,7 +1039,7 @@ namespace xsk { namespace gsc { namespace h1 { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -2293,6 +2307,8 @@ namespace xsk { namespace gsc { namespace h1 { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -2619,7 +2635,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -2634,22 +2650,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { - /// Default constructor. - by_kind (); - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that); -#endif - - /// Copy constructor. - by_kind (const by_kind& that); - /// The symbol kind as needed by the constructor. typedef token_kind_type kind_type; + /// Default constructor. + by_kind () YY_NOEXCEPT; + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that) YY_NOEXCEPT; +#endif + + /// Copy constructor. + by_kind (const by_kind& that) YY_NOEXCEPT; + /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -2679,30 +2697,34 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ H1_ASSERT (tok == token::H1EOF || (token::H1error <= tok && tok <= token::MOD) || (token::SIZEOF <= tok && tok <= token::POSTDEC)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ H1_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); +#endif } }; @@ -2751,7 +2773,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static const char *symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -4503,19 +4525,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const short yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; @@ -4542,14 +4564,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const unsigned char yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const unsigned char yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -4648,7 +4670,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -4727,7 +4749,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -4786,7 +4808,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -4805,7 +4827,7 @@ switch (yykind) inline parser::symbol_kind_type - parser::yytranslate_ (int t) + parser::yytranslate_ (int t) YY_NOEXCEPT { return static_cast (t); } @@ -5114,6 +5136,7 @@ switch (yykind) + template parser::symbol_kind_type parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -5121,6 +5144,7 @@ switch (yykind) return this->kind (); } + template bool parser::basic_symbol::empty () const YY_NOEXCEPT @@ -5431,13 +5455,13 @@ switch (yykind) // by_kind. inline - parser::by_kind::by_kind () + parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - parser::by_kind::by_kind (by_kind&& that) + parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -5445,15 +5469,17 @@ switch (yykind) #endif inline - parser::by_kind::by_kind (const by_kind& that) + parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - parser::by_kind::by_kind (token_kind_type t) + parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void parser::by_kind::clear () YY_NOEXCEPT @@ -5476,6 +5502,7 @@ switch (yykind) return kind_; } + inline parser::symbol_kind_type parser::by_kind::type_get () const YY_NOEXCEPT @@ -5483,9 +5510,10 @@ switch (yykind) return this->kind (); } + #line 13 "parser.ypp" } } } // xsk::gsc::h1 -#line 5489 "parser.hpp" +#line 5517 "parser.hpp" diff --git a/src/h1/xsk/resolver.cpp b/src/h1/xsk/resolver.cpp index 3f732be0..8ef5bf0a 100644 --- a/src/h1/xsk/resolver.cpp +++ b/src/h1/xsk/resolver.cpp @@ -6,6 +6,11 @@ #include "stdafx.hpp" #include "h1.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4244) +#endif + namespace xsk::gsc::h1 { @@ -61,7 +66,7 @@ auto resolver::function_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_func_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = function_map_rev.find(name); @@ -90,7 +95,7 @@ auto resolver::method_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_meth_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = method_map_rev.find(name); @@ -119,7 +124,7 @@ auto resolver::file_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = file_map_rev.find(name); @@ -148,7 +153,7 @@ auto resolver::token_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = token_map_rev.find(name); @@ -212,7 +217,7 @@ auto resolver::make_token(std::string_view str) -> std::string for (std::size_t i = 0; i < data.size(); i++) { - data[i] = std::tolower(str[i]); + data[i] = static_cast(std::tolower(static_cast(str[i]))); if (data[i] == '\\') data[i] = '/'; } @@ -4062,6 +4067,10 @@ __init__ _; } // namespace xsk::gsc::h1 +#ifdef _MSC_VER +#pragma warning(pop) +#endif + // ps4 function_list /* diff --git a/src/h2/stdafx.hpp b/src/h2/stdafx.hpp index f59191dd..19f22f43 100644 --- a/src/h2/stdafx.hpp +++ b/src/h2/stdafx.hpp @@ -5,38 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4005) -#pragma warning(disable:4018) -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4389) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include -// Ext using namespace std::literals; - -#include "xsk/h2.hpp" diff --git a/src/h2/xsk/assembler.cpp b/src/h2/xsk/assembler.cpp index 673badd1..1bf097d0 100644 --- a/src/h2/xsk/assembler.cpp +++ b/src/h2/xsk/assembler.cpp @@ -143,7 +143,7 @@ void assembler::assemble_function(const function::ptr& func) func->id = resolver::token_id(func->name); stack_->write(func->size); - stack_->write(func->id); + stack_->write(static_cast(func->id)); if (func->id == 0) { @@ -453,7 +453,7 @@ void assembler::assemble_end_switch(const instruction::ptr& inst) const auto count = std::stoul(inst->data[0]); - script_->write(count); + script_->write(static_cast(count)); std::uint32_t index = inst->index + 3; @@ -520,15 +520,15 @@ void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back if (expr) { - script_->write(addr - inst->index - 3); + script_->write(static_cast(addr - inst->index - 3)); } else if (back) { - script_->write((inst->index + 3) - addr); + script_->write(static_cast((inst->index + 3) - addr)); } else { - script_->write(addr - inst->index - 5); + script_->write(static_cast(addr - inst->index - 5)); } } @@ -547,11 +547,11 @@ void assembler::assemble_offset(std::int32_t offset) auto assembler::resolve_function(const std::string& name) -> std::int32_t { - for (const auto& func : functions_) + for (const auto& entry : functions_) { - if (func->name == name) + if (entry->name == name) { - return func->index; + return entry->index; } } @@ -560,11 +560,11 @@ auto assembler::resolve_function(const std::string& name) -> std::int32_t auto assembler::resolve_label(const std::string& name) -> std::int32_t { - for (const auto& func : labels_) + for (const auto& entry : labels_) { - if (func.second == name) + if (entry.second == name) { - return func.first; + return entry.first; } } diff --git a/src/h2/xsk/compiler.cpp b/src/h2/xsk/compiler.cpp index 8986990c..ce45a101 100644 --- a/src/h2/xsk/compiler.cpp +++ b/src/h2/xsk/compiler.cpp @@ -848,7 +848,7 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: emit_opcode(opcode::OP_endswitch, data); - auto offset = 7 * stmt->stmt->list.size(); + auto offset = static_cast(7 * stmt->stmt->list.size()); function_->instructions.back()->size += offset; index_ += offset; @@ -2669,7 +2669,7 @@ auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const { if (blk->local_vars.at(i).init) { - return blk->local_vars_create_count - 1 - i; + return static_cast(blk->local_vars_create_count - 1 - i); } throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); diff --git a/src/h2/xsk/decompiler.cpp b/src/h2/xsk/decompiler.cpp index 58f50ec7..5da0fd08 100644 --- a/src/h2/xsk/decompiler.cpp +++ b/src/h2/xsk/decompiler.cpp @@ -1787,7 +1787,7 @@ void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) void decompiler::decompile_infinites(const ast::stmt_list::ptr& stmt) { - for (int i = stmt->list.size() - 1; i >= 0; i--) + for (auto i = stmt->list.size() - 1; i > 0; i--) { if (stmt->list.at(i) == ast::kind::asm_jump_back) { @@ -1950,7 +1950,7 @@ void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) } } -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_end = stmt->list.at(begin).as_cond->value; @@ -1978,7 +1978,7 @@ void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t beg stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.loc_end = stmt->list.at(end).loc().label(); @@ -2029,7 +2029,7 @@ void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.is_last = true; @@ -2089,7 +2089,7 @@ void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uin } } -void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); @@ -2119,7 +2119,7 @@ void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32 stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t start, std::uint32_t end) +void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::size_t start, std::size_t end) { auto& last = block->list.at(end - 1); @@ -2184,7 +2184,7 @@ void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t decompile_while(block, start, end); } -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2214,7 +2214,7 @@ void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2245,7 +2245,7 @@ void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2299,7 +2299,7 @@ void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t be stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2366,7 +2366,7 @@ void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t start) +void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) { block blk; blk.loc_continue = blocks_.back().loc_continue; @@ -2479,7 +2479,7 @@ void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); } -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool +auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool { for (auto i = begin; i < end; i++) { @@ -2498,7 +2498,7 @@ auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::u return false; } -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t +auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t { auto index = 0u; @@ -2516,7 +2516,7 @@ auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std: throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); } -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool +auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool { if (index == stmt->list.size() - 1) return true; @@ -3334,7 +3334,7 @@ void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) { - blk->local_vars_public_count = blk->local_vars.size() - std::stoi(expr->index); + blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); } } // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/decompiler.hpp b/src/h2/xsk/decompiler.hpp index c0acddd8..cc09f43c 100644 --- a/src/h2/xsk/decompiler.hpp +++ b/src/h2/xsk/decompiler.hpp @@ -34,19 +34,19 @@ private: void decompile_switches(const ast::stmt_list::ptr& stmt); void decompile_ifelses(const ast::stmt_list::ptr& stmt); void decompile_aborts(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool; + void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); + auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; + auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; + auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; void process_stack(const ast::decl_thread::ptr& thread); void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); void process_stmt(const ast::stmt& stmt, const block::ptr& blk); diff --git a/src/h2/xsk/disassembler.cpp b/src/h2/xsk/disassembler.cpp index 666e7c7a..3cdbc753 100644 --- a/src/h2/xsk/disassembler.cpp +++ b/src/h2/xsk/disassembler.cpp @@ -51,7 +51,7 @@ void disassembler::disassemble(const std::string& file, std::vectorindex = static_cast(script_->pos()); func->size = stack_->read(); func->id = stack_->read(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id); + func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); dissasemble_function(func); diff --git a/src/h2/xsk/lexer.cpp b/src/h2/xsk/lexer.cpp index ba3ebbbd..bfbeb81c 100644 --- a/src/h2/xsk/lexer.cpp +++ b/src/h2/xsk/lexer.cpp @@ -97,7 +97,7 @@ void reader::init(const char* data, size_t size) { state = reader::ok; buffer_pos = data; - bytes_remaining = size; + bytes_remaining = static_cast(size); last_byte = 0; current_byte = *data; } diff --git a/src/h2/xsk/parser.cpp b/src/h2/xsk/parser.cpp index 4c1f5f9b..43760766 100644 --- a/src/h2/xsk/parser.cpp +++ b/src/h2/xsk/parser.cpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -35,7 +35,7 @@ // private implementation details that can be changed or removed. // "%code top" blocks. -#line 34 "parser.ypp" +#line 38 "parser.ypp" #include "stdafx.hpp" #include "parser.hpp" @@ -166,9 +166,9 @@ namespace xsk { namespace gsc { namespace h2 { parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -1467,7 +1467,7 @@ namespace xsk { namespace gsc { namespace h2 { } void - parser::yypop_ (int n) + parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -1510,13 +1510,13 @@ namespace xsk { namespace gsc { namespace h2 { } bool - parser::yy_pact_value_is_default_ (int yyvalue) + parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - parser::yy_table_value_is_error_ (int yyvalue) + parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -1547,8 +1547,8 @@ namespace xsk { namespace gsc { namespace h2 { /// The return value of parse (). int yyresult; - /// Discard the LAC context in case there still is one left from a - /// previous invocation. + // Discard the LAC context in case there still is one left from a + // previous invocation. yy_lac_discard_ ("init"); #if YY_EXCEPTIONS @@ -1626,7 +1626,7 @@ namespace xsk { namespace gsc { namespace h2 { if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) { if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; goto yydefault; } @@ -1637,7 +1637,7 @@ namespace xsk { namespace gsc { namespace h2 { if (yy_table_value_is_error_ (yyn)) goto yyerrlab; if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -1984,1315 +1984,1315 @@ namespace xsk { namespace gsc { namespace h2 { switch (yyn) { case 2: // root: program -#line 255 "parser.ypp" +#line 259 "parser.ypp" { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } #line 1990 "parser.cpp" break; case 3: // root: %empty -#line 256 "parser.ypp" +#line 260 "parser.ypp" { ast = std::make_unique(yylhs.location); } #line 1996 "parser.cpp" break; case 4: // program: program inline -#line 261 "parser.ypp" +#line 265 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } #line 2002 "parser.cpp" break; case 5: // program: program include -#line 263 "parser.ypp" +#line 267 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2008 "parser.cpp" break; case 6: // program: program declaration -#line 265 "parser.ypp" +#line 269 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2014 "parser.cpp" break; case 7: // program: inline -#line 267 "parser.ypp" +#line 271 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } #line 2020 "parser.cpp" break; case 8: // program: include -#line 269 "parser.ypp" +#line 273 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2026 "parser.cpp" break; case 9: // program: declaration -#line 271 "parser.ypp" +#line 275 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2032 "parser.cpp" break; case 10: // inline: "#inline" expr_path ";" -#line 275 "parser.ypp" +#line 279 "parser.ypp" { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } #line 2038 "parser.cpp" break; case 11: // include: "#include" expr_path ";" -#line 280 "parser.ypp" +#line 284 "parser.ypp" { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } #line 2044 "parser.cpp" break; case 12: // declaration: "/#" -#line 284 "parser.ypp" +#line 288 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } #line 2050 "parser.cpp" break; case 13: // declaration: "#/" -#line 285 "parser.ypp" +#line 289 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } #line 2056 "parser.cpp" break; case 14: // declaration: decl_usingtree -#line 286 "parser.ypp" +#line 290 "parser.ypp" { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } #line 2062 "parser.cpp" break; case 15: // declaration: decl_constant -#line 287 "parser.ypp" +#line 291 "parser.ypp" { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } #line 2068 "parser.cpp" break; case 16: // declaration: decl_thread -#line 288 "parser.ypp" +#line 292 "parser.ypp" { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } #line 2074 "parser.cpp" break; case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 293 "parser.ypp" +#line 297 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_usingtree::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_string::ptr > ())); } #line 2080 "parser.cpp" break; case 18: // decl_constant: expr_identifier "=" expr ";" -#line 298 "parser.ypp" +#line 302 "parser.ypp" { yylhs.value.as < ast::decl_constant::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 2086 "parser.cpp" break; case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 303 "parser.ypp" +#line 307 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2092 "parser.cpp" break; case 20: // stmt: stmt_block -#line 307 "parser.ypp" +#line 311 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } #line 2098 "parser.cpp" break; case 21: // stmt: stmt_call -#line 308 "parser.ypp" +#line 312 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } #line 2104 "parser.cpp" break; case 22: // stmt: stmt_assign -#line 309 "parser.ypp" +#line 313 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } #line 2110 "parser.cpp" break; case 23: // stmt: stmt_endon -#line 310 "parser.ypp" +#line 314 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } #line 2116 "parser.cpp" break; case 24: // stmt: stmt_notify -#line 311 "parser.ypp" +#line 315 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } #line 2122 "parser.cpp" break; case 25: // stmt: stmt_wait -#line 312 "parser.ypp" +#line 316 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } #line 2128 "parser.cpp" break; case 26: // stmt: stmt_waittill -#line 313 "parser.ypp" +#line 317 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } #line 2134 "parser.cpp" break; case 27: // stmt: stmt_waittillmatch -#line 314 "parser.ypp" +#line 318 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } #line 2140 "parser.cpp" break; case 28: // stmt: stmt_waittillframeend -#line 315 "parser.ypp" +#line 319 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } #line 2146 "parser.cpp" break; case 29: // stmt: stmt_waitframe -#line 316 "parser.ypp" +#line 320 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waitframe = std::move(yystack_[0].value.as < ast::stmt_waitframe::ptr > ()); } #line 2152 "parser.cpp" break; case 30: // stmt: stmt_if -#line 317 "parser.ypp" +#line 321 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } #line 2158 "parser.cpp" break; case 31: // stmt: stmt_ifelse -#line 318 "parser.ypp" +#line 322 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } #line 2164 "parser.cpp" break; case 32: // stmt: stmt_while -#line 319 "parser.ypp" +#line 323 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } #line 2170 "parser.cpp" break; case 33: // stmt: stmt_dowhile -#line 320 "parser.ypp" +#line 324 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } #line 2176 "parser.cpp" break; case 34: // stmt: stmt_for -#line 321 "parser.ypp" +#line 325 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } #line 2182 "parser.cpp" break; case 35: // stmt: stmt_foreach -#line 322 "parser.ypp" +#line 326 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } #line 2188 "parser.cpp" break; case 36: // stmt: stmt_switch -#line 323 "parser.ypp" +#line 327 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } #line 2194 "parser.cpp" break; case 37: // stmt: stmt_case -#line 324 "parser.ypp" +#line 328 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } #line 2200 "parser.cpp" break; case 38: // stmt: stmt_default -#line 325 "parser.ypp" +#line 329 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } #line 2206 "parser.cpp" break; case 39: // stmt: stmt_break -#line 326 "parser.ypp" +#line 330 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } #line 2212 "parser.cpp" break; case 40: // stmt: stmt_continue -#line 327 "parser.ypp" +#line 331 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } #line 2218 "parser.cpp" break; case 41: // stmt: stmt_return -#line 328 "parser.ypp" +#line 332 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } #line 2224 "parser.cpp" break; case 42: // stmt: stmt_breakpoint -#line 329 "parser.ypp" +#line 333 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } #line 2230 "parser.cpp" break; case 43: // stmt: stmt_prof_begin -#line 330 "parser.ypp" +#line 334 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } #line 2236 "parser.cpp" break; case 44: // stmt: stmt_prof_end -#line 331 "parser.ypp" +#line 335 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } #line 2242 "parser.cpp" break; case 45: // stmt_or_dev: stmt -#line 335 "parser.ypp" +#line 339 "parser.ypp" { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } #line 2248 "parser.cpp" break; case 46: // stmt_or_dev: stmt_dev -#line 336 "parser.ypp" +#line 340 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } #line 2254 "parser.cpp" break; case 47: // stmt_list: stmt_list stmt -#line 341 "parser.ypp" +#line 345 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2260 "parser.cpp" break; case 48: // stmt_list: stmt -#line 343 "parser.ypp" +#line 347 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2266 "parser.cpp" break; case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 348 "parser.ypp" +#line 352 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2272 "parser.cpp" break; case 50: // stmt_or_dev_list: stmt_or_dev -#line 350 "parser.ypp" +#line 354 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2278 "parser.cpp" break; case 51: // stmt_dev: "/#" stmt_list "#/" -#line 354 "parser.ypp" +#line 358 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::stmt_list::ptr > ())); } #line 2284 "parser.cpp" break; case 52: // stmt_dev: "/#" "#/" -#line 355 "parser.ypp" +#line 359 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2290 "parser.cpp" break; case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 359 "parser.ypp" +#line 363 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } #line 2296 "parser.cpp" break; case 54: // stmt_block: "{" "}" -#line 360 "parser.ypp" +#line 364 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } #line 2302 "parser.cpp" break; case 55: // stmt_expr: expr_assign -#line 365 "parser.ypp" +#line 369 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2308 "parser.cpp" break; case 56: // stmt_expr: expr_increment -#line 367 "parser.ypp" +#line 371 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2314 "parser.cpp" break; case 57: // stmt_expr: expr_decrement -#line 369 "parser.ypp" +#line 373 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2320 "parser.cpp" break; case 58: // stmt_expr: %empty -#line 371 "parser.ypp" +#line 375 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2326 "parser.cpp" break; case 59: // stmt_call: expr_call ";" -#line 376 "parser.ypp" +#line 380 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_call::ptr > ()))); } #line 2332 "parser.cpp" break; case 60: // stmt_call: expr_method ";" -#line 378 "parser.ypp" +#line 382 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_method::ptr > ()))); } #line 2338 "parser.cpp" break; case 61: // stmt_assign: expr_assign ";" -#line 383 "parser.ypp" +#line 387 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2344 "parser.cpp" break; case 62: // stmt_assign: expr_increment ";" -#line 385 "parser.ypp" +#line 389 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2350 "parser.cpp" break; case 63: // stmt_assign: expr_decrement ";" -#line 387 "parser.ypp" +#line 391 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2356 "parser.cpp" break; case 64: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 392 "parser.ypp" +#line 396 "parser.ypp" { yylhs.value.as < ast::stmt_endon::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ())); } #line 2362 "parser.cpp" break; case 65: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 397 "parser.ypp" +#line 401 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2368 "parser.cpp" break; case 66: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 399 "parser.ypp" +#line 403 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2374 "parser.cpp" break; case 67: // stmt_wait: "wait" expr ";" -#line 404 "parser.ypp" +#line 408 "parser.ypp" { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2380 "parser.cpp" break; case 68: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 409 "parser.ypp" +#line 413 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2386 "parser.cpp" break; case 69: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 411 "parser.ypp" +#line 415 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2392 "parser.cpp" break; case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 416 "parser.ypp" +#line 420 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2398 "parser.cpp" break; case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 418 "parser.ypp" +#line 422 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2404 "parser.cpp" break; case 72: // stmt_waittillframeend: "waittillframeend" ";" -#line 423 "parser.ypp" +#line 427 "parser.ypp" { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } #line 2410 "parser.cpp" break; case 73: // stmt_waitframe: "waitframe" ";" -#line 428 "parser.ypp" +#line 432 "parser.ypp" { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } #line 2416 "parser.cpp" break; case 74: // stmt_waitframe: "waitframe" "(" ")" ";" -#line 430 "parser.ypp" +#line 434 "parser.ypp" { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } #line 2422 "parser.cpp" break; case 75: // stmt_if: "if" "(" expr ")" stmt -#line 435 "parser.ypp" +#line 439 "parser.ypp" { yylhs.value.as < ast::stmt_if::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2428 "parser.cpp" break; case 76: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 440 "parser.ypp" +#line 444 "parser.ypp" { yylhs.value.as < ast::stmt_ifelse::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::stmt > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2434 "parser.cpp" break; case 77: // stmt_while: "while" "(" expr ")" stmt -#line 445 "parser.ypp" +#line 449 "parser.ypp" { yylhs.value.as < ast::stmt_while::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2440 "parser.cpp" break; case 78: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 450 "parser.ypp" +#line 454 "parser.ypp" { yylhs.value.as < ast::stmt_dowhile::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[5].value.as < ast::stmt > ())); } #line 2446 "parser.cpp" break; case 79: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 455 "parser.ypp" +#line 459 "parser.ypp" { yylhs.value.as < ast::stmt_for::ptr > () = std::make_unique(yylhs.location, ast::stmt(std::move(yystack_[6].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[4].value.as < ast::expr > ()), ast::stmt(std::move(yystack_[2].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2452 "parser.cpp" break; case 80: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 460 "parser.ypp" +#line 464 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2458 "parser.cpp" break; case 81: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 462 "parser.ypp" +#line 466 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[6].value.as < ast::expr_identifier::ptr > ())), ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2464 "parser.cpp" break; case 82: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 467 "parser.ypp" +#line 471 "parser.ypp" { yylhs.value.as < ast::stmt_switch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2470 "parser.cpp" break; case 83: // stmt_case: "case" expr_integer ":" -#line 472 "parser.ypp" +#line 476 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_integer::ptr > ())), std::make_unique(yylhs.location)); } #line 2476 "parser.cpp" break; case 84: // stmt_case: "case" expr_string ":" -#line 474 "parser.ypp" +#line 478 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_string::ptr > ())), std::make_unique(yylhs.location)); } #line 2482 "parser.cpp" break; case 85: // stmt_default: "default" ":" -#line 479 "parser.ypp" +#line 483 "parser.ypp" { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2488 "parser.cpp" break; case 86: // stmt_break: "break" ";" -#line 484 "parser.ypp" +#line 488 "parser.ypp" { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } #line 2494 "parser.cpp" break; case 87: // stmt_continue: "continue" ";" -#line 489 "parser.ypp" +#line 493 "parser.ypp" { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } #line 2500 "parser.cpp" break; case 88: // stmt_return: "return" expr ";" -#line 494 "parser.ypp" +#line 498 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2506 "parser.cpp" break; case 89: // stmt_return: "return" ";" -#line 496 "parser.ypp" +#line 500 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2512 "parser.cpp" break; case 90: // stmt_breakpoint: "breakpoint" ";" -#line 501 "parser.ypp" +#line 505 "parser.ypp" { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } #line 2518 "parser.cpp" break; case 91: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 506 "parser.ypp" +#line 510 "parser.ypp" { yylhs.value.as < ast::stmt_prof_begin::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2524 "parser.cpp" break; case 92: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 511 "parser.ypp" +#line 515 "parser.ypp" { yylhs.value.as < ast::stmt_prof_end::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2530 "parser.cpp" break; case 93: // expr: expr_ternary -#line 515 "parser.ypp" +#line 519 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2536 "parser.cpp" break; case 94: // expr: expr_binary -#line 516 "parser.ypp" +#line 520 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2542 "parser.cpp" break; case 95: // expr: expr_primitive -#line 517 "parser.ypp" +#line 521 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2548 "parser.cpp" break; case 96: // expr_or_empty: expr -#line 521 "parser.ypp" +#line 525 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2554 "parser.cpp" break; case 97: // expr_or_empty: %empty -#line 522 "parser.ypp" +#line 526 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } #line 2560 "parser.cpp" break; case 98: // expr_assign: expr_object "=" expr -#line 527 "parser.ypp" +#line 531 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2566 "parser.cpp" break; case 99: // expr_assign: expr_object "|=" expr -#line 529 "parser.ypp" +#line 533 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2572 "parser.cpp" break; case 100: // expr_assign: expr_object "&=" expr -#line 531 "parser.ypp" +#line 535 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2578 "parser.cpp" break; case 101: // expr_assign: expr_object "^=" expr -#line 533 "parser.ypp" +#line 537 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2584 "parser.cpp" break; case 102: // expr_assign: expr_object "<<=" expr -#line 535 "parser.ypp" +#line 539 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()),std::move( yystack_[0].value.as < ast::expr > ())); } #line 2590 "parser.cpp" break; case 103: // expr_assign: expr_object ">>=" expr -#line 537 "parser.ypp" +#line 541 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2596 "parser.cpp" break; case 104: // expr_assign: expr_object "+=" expr -#line 539 "parser.ypp" +#line 543 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2602 "parser.cpp" break; case 105: // expr_assign: expr_object "-=" expr -#line 541 "parser.ypp" +#line 545 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2608 "parser.cpp" break; case 106: // expr_assign: expr_object "*=" expr -#line 543 "parser.ypp" +#line 547 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2614 "parser.cpp" break; case 107: // expr_assign: expr_object "/=" expr -#line 545 "parser.ypp" +#line 549 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2620 "parser.cpp" break; case 108: // expr_assign: expr_object "%=" expr -#line 547 "parser.ypp" +#line 551 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2626 "parser.cpp" break; case 109: // expr_increment: "++" expr_object -#line 552 "parser.ypp" +#line 556 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2632 "parser.cpp" break; case 110: // expr_increment: expr_object "++" -#line 554 "parser.ypp" +#line 558 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2638 "parser.cpp" break; case 111: // expr_decrement: "--" expr_object -#line 559 "parser.ypp" +#line 563 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2644 "parser.cpp" break; case 112: // expr_decrement: expr_object "--" -#line 561 "parser.ypp" +#line 565 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2650 "parser.cpp" break; case 113: // expr_ternary: expr "?" expr ":" expr -#line 566 "parser.ypp" +#line 570 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2656 "parser.cpp" break; case 114: // expr_binary: expr "||" expr -#line 571 "parser.ypp" +#line 575 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2662 "parser.cpp" break; case 115: // expr_binary: expr "&&" expr -#line 573 "parser.ypp" +#line 577 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2668 "parser.cpp" break; case 116: // expr_binary: expr "==" expr -#line 575 "parser.ypp" +#line 579 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2674 "parser.cpp" break; case 117: // expr_binary: expr "!=" expr -#line 577 "parser.ypp" +#line 581 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2680 "parser.cpp" break; case 118: // expr_binary: expr "<=" expr -#line 579 "parser.ypp" +#line 583 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2686 "parser.cpp" break; case 119: // expr_binary: expr ">=" expr -#line 581 "parser.ypp" +#line 585 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2692 "parser.cpp" break; case 120: // expr_binary: expr "<" expr -#line 583 "parser.ypp" +#line 587 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2698 "parser.cpp" break; case 121: // expr_binary: expr ">" expr -#line 585 "parser.ypp" +#line 589 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2704 "parser.cpp" break; case 122: // expr_binary: expr "|" expr -#line 587 "parser.ypp" +#line 591 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2710 "parser.cpp" break; case 123: // expr_binary: expr "&" expr -#line 589 "parser.ypp" +#line 593 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2716 "parser.cpp" break; case 124: // expr_binary: expr "^" expr -#line 591 "parser.ypp" +#line 595 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2722 "parser.cpp" break; case 125: // expr_binary: expr "<<" expr -#line 593 "parser.ypp" +#line 597 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2728 "parser.cpp" break; case 126: // expr_binary: expr ">>" expr -#line 595 "parser.ypp" +#line 599 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2734 "parser.cpp" break; case 127: // expr_binary: expr "+" expr -#line 597 "parser.ypp" +#line 601 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2740 "parser.cpp" break; case 128: // expr_binary: expr "-" expr -#line 599 "parser.ypp" +#line 603 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2746 "parser.cpp" break; case 129: // expr_binary: expr "*" expr -#line 601 "parser.ypp" +#line 605 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2752 "parser.cpp" break; case 130: // expr_binary: expr "/" expr -#line 603 "parser.ypp" +#line 607 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2758 "parser.cpp" break; case 131: // expr_binary: expr "%" expr -#line 605 "parser.ypp" +#line 609 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2764 "parser.cpp" break; case 132: // expr_primitive: expr_complement -#line 609 "parser.ypp" +#line 613 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } #line 2770 "parser.cpp" break; case 133: // expr_primitive: expr_not -#line 610 "parser.ypp" +#line 614 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } #line 2776 "parser.cpp" break; case 134: // expr_primitive: expr_call -#line 611 "parser.ypp" +#line 615 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 2782 "parser.cpp" break; case 135: // expr_primitive: expr_method -#line 612 "parser.ypp" +#line 616 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 2788 "parser.cpp" break; case 136: // expr_primitive: expr_add_array -#line 613 "parser.ypp" +#line 617 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } #line 2794 "parser.cpp" break; case 137: // expr_primitive: expr_reference -#line 614 "parser.ypp" +#line 618 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } #line 2800 "parser.cpp" break; case 138: // expr_primitive: expr_array -#line 615 "parser.ypp" +#line 619 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 2806 "parser.cpp" break; case 139: // expr_primitive: expr_field -#line 616 "parser.ypp" +#line 620 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 2812 "parser.cpp" break; case 140: // expr_primitive: expr_size -#line 617 "parser.ypp" +#line 621 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } #line 2818 "parser.cpp" break; case 141: // expr_primitive: expr_paren -#line 618 "parser.ypp" +#line 622 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } #line 2824 "parser.cpp" break; case 142: // expr_primitive: expr_thisthread -#line 619 "parser.ypp" +#line 623 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } #line 2830 "parser.cpp" break; case 143: // expr_primitive: expr_empty_array -#line 620 "parser.ypp" +#line 624 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } #line 2836 "parser.cpp" break; case 144: // expr_primitive: expr_undefined -#line 621 "parser.ypp" +#line 625 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } #line 2842 "parser.cpp" break; case 145: // expr_primitive: expr_game -#line 622 "parser.ypp" +#line 626 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 2848 "parser.cpp" break; case 146: // expr_primitive: expr_self -#line 623 "parser.ypp" +#line 627 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 2854 "parser.cpp" break; case 147: // expr_primitive: expr_anim -#line 624 "parser.ypp" +#line 628 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 2860 "parser.cpp" break; case 148: // expr_primitive: expr_level -#line 625 "parser.ypp" +#line 629 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 2866 "parser.cpp" break; case 149: // expr_primitive: expr_animation -#line 626 "parser.ypp" +#line 630 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } #line 2872 "parser.cpp" break; case 150: // expr_primitive: expr_animtree -#line 627 "parser.ypp" +#line 631 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } #line 2878 "parser.cpp" break; case 151: // expr_primitive: expr_identifier -#line 628 "parser.ypp" +#line 632 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 2884 "parser.cpp" break; case 152: // expr_primitive: expr_istring -#line 629 "parser.ypp" +#line 633 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } #line 2890 "parser.cpp" break; case 153: // expr_primitive: expr_string -#line 630 "parser.ypp" +#line 634 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } #line 2896 "parser.cpp" break; case 154: // expr_primitive: expr_vector -#line 631 "parser.ypp" +#line 635 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } #line 2902 "parser.cpp" break; case 155: // expr_primitive: expr_float -#line 632 "parser.ypp" +#line 636 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } #line 2908 "parser.cpp" break; case 156: // expr_primitive: expr_integer -#line 633 "parser.ypp" +#line 637 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } #line 2914 "parser.cpp" break; case 157: // expr_primitive: expr_false -#line 634 "parser.ypp" +#line 638 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } #line 2920 "parser.cpp" break; case 158: // expr_primitive: expr_true -#line 635 "parser.ypp" +#line 639 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } #line 2926 "parser.cpp" break; case 159: // expr_complement: "~" expr -#line 640 "parser.ypp" +#line 644 "parser.ypp" { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2932 "parser.cpp" break; case 160: // expr_not: "!" expr -#line 645 "parser.ypp" +#line 649 "parser.ypp" { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2938 "parser.cpp" break; case 161: // expr_call: expr_function -#line 649 "parser.ypp" +#line 653 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2944 "parser.cpp" break; case 162: // expr_call: expr_pointer -#line 650 "parser.ypp" +#line 654 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2950 "parser.cpp" break; case 163: // expr_method: expr_object expr_function -#line 653 "parser.ypp" +#line 657 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 2956 "parser.cpp" break; case 164: // expr_method: expr_object expr_pointer -#line 654 "parser.ypp" +#line 658 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 2962 "parser.cpp" break; case 165: // expr_function: expr_identifier "(" expr_arguments ")" -#line 659 "parser.ypp" +#line 663 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2968 "parser.cpp" break; case 166: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 661 "parser.ypp" +#line 665 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2974 "parser.cpp" break; case 167: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 663 "parser.ypp" +#line 667 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2980 "parser.cpp" break; case 168: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 665 "parser.ypp" +#line 669 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2986 "parser.cpp" break; case 169: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 667 "parser.ypp" +#line 671 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2992 "parser.cpp" break; case 170: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 669 "parser.ypp" +#line 673 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2998 "parser.cpp" break; case 171: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 674 "parser.ypp" +#line 678 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3004 "parser.cpp" break; case 172: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 676 "parser.ypp" +#line 680 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3010 "parser.cpp" break; case 173: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 678 "parser.ypp" +#line 682 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 3016 "parser.cpp" break; case 174: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 680 "parser.ypp" +#line 684 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::builtin); } #line 3022 "parser.cpp" break; case 175: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 685 "parser.ypp" +#line 689 "parser.ypp" { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } #line 3028 "parser.cpp" break; case 176: // expr_parameters: expr_parameters "," expr_identifier -#line 690 "parser.ypp" +#line 694 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3034 "parser.cpp" break; case 177: // expr_parameters: expr_identifier -#line 692 "parser.ypp" +#line 696 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3040 "parser.cpp" break; case 178: // expr_parameters: %empty -#line 694 "parser.ypp" +#line 698 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } #line 3046 "parser.cpp" break; case 179: // expr_arguments: expr_arguments_no_empty -#line 699 "parser.ypp" +#line 703 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } #line 3052 "parser.cpp" break; case 180: // expr_arguments: %empty -#line 701 "parser.ypp" +#line 705 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } #line 3058 "parser.cpp" break; case 181: // expr_arguments_no_empty: expr_arguments "," expr -#line 706 "parser.ypp" +#line 710 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ()); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3064 "parser.cpp" break; case 182: // expr_arguments_no_empty: expr -#line 708 "parser.ypp" +#line 712 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3070 "parser.cpp" break; case 183: // expr_reference: "::" expr_identifier -#line 713 "parser.ypp" +#line 717 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3076 "parser.cpp" break; case 184: // expr_reference: expr_path "::" expr_identifier -#line 715 "parser.ypp" +#line 719 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_path::ptr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3082 "parser.cpp" break; case 185: // expr_array: expr_object "[" expr "]" -#line 720 "parser.ypp" +#line 724 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3088 "parser.cpp" break; case 186: // expr_field: expr_object "." expr_identifier_nosize -#line 725 "parser.ypp" +#line 729 "parser.ypp" { yylhs.value.as < ast::expr_field::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3094 "parser.cpp" break; case 187: // expr_size: expr_object "." "size" -#line 730 "parser.ypp" +#line 734 "parser.ypp" { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } #line 3100 "parser.cpp" break; case 188: // expr_paren: "(" expr ")" -#line 735 "parser.ypp" +#line 739 "parser.ypp" { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3106 "parser.cpp" break; case 189: // expr_object: expr_call -#line 739 "parser.ypp" +#line 743 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 3112 "parser.cpp" break; case 190: // expr_object: expr_method -#line 740 "parser.ypp" +#line 744 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 3118 "parser.cpp" break; case 191: // expr_object: expr_array -#line 741 "parser.ypp" +#line 745 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 3124 "parser.cpp" break; case 192: // expr_object: expr_field -#line 742 "parser.ypp" +#line 746 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 3130 "parser.cpp" break; case 193: // expr_object: expr_game -#line 743 "parser.ypp" +#line 747 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 3136 "parser.cpp" break; case 194: // expr_object: expr_self -#line 744 "parser.ypp" +#line 748 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 3142 "parser.cpp" break; case 195: // expr_object: expr_anim -#line 745 "parser.ypp" +#line 749 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 3148 "parser.cpp" break; case 196: // expr_object: expr_level -#line 746 "parser.ypp" +#line 750 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 3154 "parser.cpp" break; case 197: // expr_object: expr_identifier -#line 747 "parser.ypp" +#line 751 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 3160 "parser.cpp" break; case 198: // expr_thisthread: "thisthread" -#line 752 "parser.ypp" +#line 756 "parser.ypp" { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } #line 3166 "parser.cpp" break; case 199: // expr_empty_array: "[" "]" -#line 757 "parser.ypp" +#line 761 "parser.ypp" { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } #line 3172 "parser.cpp" break; case 200: // expr_undefined: "undefined" -#line 762 "parser.ypp" +#line 766 "parser.ypp" { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } #line 3178 "parser.cpp" break; case 201: // expr_game: "game" -#line 767 "parser.ypp" +#line 771 "parser.ypp" { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } #line 3184 "parser.cpp" break; case 202: // expr_self: "self" -#line 772 "parser.ypp" +#line 776 "parser.ypp" { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } #line 3190 "parser.cpp" break; case 203: // expr_anim: "anim" -#line 777 "parser.ypp" +#line 781 "parser.ypp" { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } #line 3196 "parser.cpp" break; case 204: // expr_level: "level" -#line 782 "parser.ypp" +#line 786 "parser.ypp" { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } #line 3202 "parser.cpp" break; case 205: // expr_animation: "%" "identifier" -#line 787 "parser.ypp" +#line 791 "parser.ypp" { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3208 "parser.cpp" break; case 206: // expr_animtree: "#animtree" -#line 792 "parser.ypp" +#line 796 "parser.ypp" { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } #line 3214 "parser.cpp" break; case 207: // expr_identifier_nosize: "identifier" -#line 797 "parser.ypp" +#line 801 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3220 "parser.cpp" break; case 208: // expr_identifier: "identifier" -#line 802 "parser.ypp" +#line 806 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3226 "parser.cpp" break; case 209: // expr_identifier: "size" -#line 804 "parser.ypp" +#line 808 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } #line 3232 "parser.cpp" break; case 210: // expr_path: "identifier" -#line 809 "parser.ypp" +#line 813 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3238 "parser.cpp" break; case 211: // expr_path: "path" -#line 811 "parser.ypp" +#line 815 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3244 "parser.cpp" break; case 212: // expr_istring: "localized string" -#line 816 "parser.ypp" +#line 820 "parser.ypp" { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3250 "parser.cpp" break; case 213: // expr_string: "string literal" -#line 821 "parser.ypp" +#line 825 "parser.ypp" { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3256 "parser.cpp" break; case 214: // expr_vector: "(" expr "," expr "," expr ")" -#line 826 "parser.ypp" +#line 830 "parser.ypp" { yylhs.value.as < ast::expr_vector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3262 "parser.cpp" break; case 215: // expr_float: "-" "float" -#line 831 "parser.ypp" +#line 835 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3268 "parser.cpp" break; case 216: // expr_float: "float" -#line 833 "parser.ypp" +#line 837 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3274 "parser.cpp" break; case 217: // expr_integer: "-" "integer" -#line 838 "parser.ypp" +#line 842 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3280 "parser.cpp" break; case 218: // expr_integer: "integer" -#line 840 "parser.ypp" +#line 844 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3286 "parser.cpp" break; case 219: // expr_false: "false" -#line 845 "parser.ypp" +#line 849 "parser.ypp" { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } #line 3292 "parser.cpp" break; case 220: // expr_true: "true" -#line 850 "parser.ypp" +#line 854 "parser.ypp" { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } #line 3298 "parser.cpp" break; @@ -3562,6 +3562,8 @@ namespace xsk { namespace gsc { namespace h2 { } + + bool parser::yy_lac_check_ (symbol_kind_type yytoken) const { @@ -3666,7 +3668,9 @@ namespace xsk { namespace gsc { namespace h2 { follows. If no initial context is currently established for the current lookahead, then check if that lookahead can eventually be shifted if syntactic actions continue from the current context. */ - if (!yy_lac_established_) + if (yy_lac_established_) + return true; + else { #if H2DEBUG YYCDEBUG << "LAC: initial context established for " @@ -3675,12 +3679,11 @@ namespace xsk { namespace gsc { namespace h2 { yy_lac_established_ = true; return yy_lac_check_ (yytoken); } - return true; } // Discard any previous initial lookahead context. void - parser::yy_lac_discard_ (const char* evt) + parser::yy_lac_discard_ (const char* event) { /* Discard any previous initial lookahead context because of Event, which may be a lookahead change or an invalidation of the currently @@ -3696,11 +3699,12 @@ namespace xsk { namespace gsc { namespace h2 { if (yy_lac_established_) { YYCDEBUG << "LAC: initial context discarded due to " - << evt << '\n'; + << event << '\n'; yy_lac_established_ = false; } } + int parser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -4487,29 +4491,29 @@ namespace xsk { namespace gsc { namespace h2 { const short parser::yyrline_[] = { - 0, 255, 255, 256, 260, 262, 264, 266, 268, 270, - 275, 279, 284, 285, 286, 287, 288, 292, 297, 302, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 335, 336, 340, 342, 347, - 349, 354, 355, 359, 360, 364, 366, 368, 371, 375, - 377, 382, 384, 386, 391, 396, 398, 403, 408, 410, - 415, 417, 422, 427, 429, 434, 439, 444, 449, 454, - 459, 461, 466, 471, 473, 478, 483, 488, 493, 495, - 500, 505, 510, 515, 516, 517, 521, 522, 526, 528, - 530, 532, 534, 536, 538, 540, 542, 544, 546, 551, - 553, 558, 560, 565, 570, 572, 574, 576, 578, 580, - 582, 584, 586, 588, 590, 592, 594, 596, 598, 600, - 602, 604, 609, 610, 611, 612, 613, 614, 615, 616, - 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 639, - 644, 649, 650, 653, 654, 658, 660, 662, 664, 666, - 668, 673, 675, 677, 679, 684, 689, 691, 694, 698, - 701, 705, 707, 712, 714, 719, 724, 729, 734, 739, - 740, 741, 742, 743, 744, 745, 746, 747, 751, 756, - 761, 766, 771, 776, 781, 786, 791, 796, 801, 803, - 808, 810, 815, 820, 825, 830, 832, 837, 839, 844, - 849 + 0, 259, 259, 260, 264, 266, 268, 270, 272, 274, + 279, 283, 288, 289, 290, 291, 292, 296, 301, 306, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 339, 340, 344, 346, 351, + 353, 358, 359, 363, 364, 368, 370, 372, 375, 379, + 381, 386, 388, 390, 395, 400, 402, 407, 412, 414, + 419, 421, 426, 431, 433, 438, 443, 448, 453, 458, + 463, 465, 470, 475, 477, 482, 487, 492, 497, 499, + 504, 509, 514, 519, 520, 521, 525, 526, 530, 532, + 534, 536, 538, 540, 542, 544, 546, 548, 550, 555, + 557, 562, 564, 569, 574, 576, 578, 580, 582, 584, + 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, + 606, 608, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 643, + 648, 653, 654, 657, 658, 662, 664, 666, 668, 670, + 672, 677, 679, 681, 683, 688, 693, 695, 698, 702, + 705, 709, 711, 716, 718, 723, 728, 733, 738, 743, + 744, 745, 746, 747, 748, 749, 750, 751, 755, 760, + 765, 770, 775, 780, 785, 790, 795, 800, 805, 807, + 812, 814, 819, 824, 829, 834, 836, 841, 843, 848, + 853 }; void @@ -4542,9 +4546,9 @@ namespace xsk { namespace gsc { namespace h2 { #line 13 "parser.ypp" } } } // xsk::gsc::h2 -#line 4546 "parser.cpp" +#line 4550 "parser.cpp" -#line 853 "parser.ypp" +#line 857 "parser.ypp" void xsk::gsc::h2::parser::error(const xsk::gsc::location& loc, const std::string& msg) diff --git a/src/h2/xsk/parser.hpp b/src/h2/xsk/parser.hpp index 3aa334be..da5bfcc0 100644 --- a/src/h2/xsk/parser.hpp +++ b/src/h2/xsk/parser.hpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -47,10 +47,14 @@ // "%code requires" blocks. #line 28 "parser.ypp" +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "h2.hpp" namespace xsk::gsc::h2 { class lexer; } -#line 54 "parser.hpp" +#line 58 "parser.hpp" # include # include // std::abort @@ -126,12 +130,18 @@ namespace xsk::gsc::h2 { class lexer; } # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -193,7 +203,7 @@ namespace xsk::gsc::h2 { class lexer; } #line 13 "parser.ypp" namespace xsk { namespace gsc { namespace h2 { -#line 197 "parser.hpp" +#line 207 "parser.hpp" @@ -202,27 +212,32 @@ namespace xsk { namespace gsc { namespace h2 { class parser { public: -#ifndef H2STYPE +#ifdef H2STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define H2STYPE in C++, use %define api.value.type" +# endif + typedef H2STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { H2_ASSERT (sizeof (T) <= size); @@ -231,13 +246,13 @@ namespace xsk { namespace gsc { namespace h2 { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { H2_ASSERT (!yytypeid_); } @@ -381,7 +396,7 @@ namespace xsk { namespace gsc { namespace h2 { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -391,7 +406,7 @@ namespace xsk { namespace gsc { namespace h2 { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -400,7 +415,7 @@ namespace xsk { namespace gsc { namespace h2 { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -635,18 +650,19 @@ namespace xsk { namespace gsc { namespace h2 { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef H2STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef xsk::gsc::location location_type; @@ -793,7 +809,7 @@ namespace xsk { namespace gsc { namespace h2 { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -1023,7 +1039,7 @@ namespace xsk { namespace gsc { namespace h2 { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -2291,6 +2307,8 @@ namespace xsk { namespace gsc { namespace h2 { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -2617,7 +2635,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -2632,22 +2650,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { - /// Default constructor. - by_kind (); - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that); -#endif - - /// Copy constructor. - by_kind (const by_kind& that); - /// The symbol kind as needed by the constructor. typedef token_kind_type kind_type; + /// Default constructor. + by_kind () YY_NOEXCEPT; + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that) YY_NOEXCEPT; +#endif + + /// Copy constructor. + by_kind (const by_kind& that) YY_NOEXCEPT; + /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -2677,30 +2697,34 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ H2_ASSERT (tok == token::H2EOF || (token::H2error <= tok && tok <= token::MOD) || (token::SIZEOF <= tok && tok <= token::POSTDEC)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ H2_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); +#endif } }; @@ -2749,7 +2773,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static const char *symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -4501,19 +4525,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const short yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; @@ -4540,14 +4564,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const unsigned char yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const unsigned char yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -4646,7 +4670,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -4725,7 +4749,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -4784,7 +4808,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -4803,7 +4827,7 @@ switch (yykind) inline parser::symbol_kind_type - parser::yytranslate_ (int t) + parser::yytranslate_ (int t) YY_NOEXCEPT { return static_cast (t); } @@ -5112,6 +5136,7 @@ switch (yykind) + template parser::symbol_kind_type parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -5119,6 +5144,7 @@ switch (yykind) return this->kind (); } + template bool parser::basic_symbol::empty () const YY_NOEXCEPT @@ -5429,13 +5455,13 @@ switch (yykind) // by_kind. inline - parser::by_kind::by_kind () + parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - parser::by_kind::by_kind (by_kind&& that) + parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -5443,15 +5469,17 @@ switch (yykind) #endif inline - parser::by_kind::by_kind (const by_kind& that) + parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - parser::by_kind::by_kind (token_kind_type t) + parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void parser::by_kind::clear () YY_NOEXCEPT @@ -5474,6 +5502,7 @@ switch (yykind) return kind_; } + inline parser::symbol_kind_type parser::by_kind::type_get () const YY_NOEXCEPT @@ -5481,9 +5510,10 @@ switch (yykind) return this->kind (); } + #line 13 "parser.ypp" } } } // xsk::gsc::h2 -#line 5487 "parser.hpp" +#line 5517 "parser.hpp" diff --git a/src/h2/xsk/resolver.cpp b/src/h2/xsk/resolver.cpp index 0dd49c11..c84073de 100644 --- a/src/h2/xsk/resolver.cpp +++ b/src/h2/xsk/resolver.cpp @@ -6,6 +6,11 @@ #include "stdafx.hpp" #include "h2.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4244) +#endif + namespace xsk::gsc::h2 { @@ -61,7 +66,7 @@ auto resolver::function_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_func_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = function_map_rev.find(name); @@ -90,7 +95,7 @@ auto resolver::method_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_meth_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = method_map_rev.find(name); @@ -119,7 +124,7 @@ auto resolver::file_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = file_map_rev.find(name); @@ -148,7 +153,7 @@ auto resolver::token_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = token_map_rev.find(name); @@ -212,7 +217,7 @@ auto resolver::make_token(std::string_view str) -> std::string for (std::size_t i = 0; i < data.size(); i++) { - data[i] = std::tolower(str[i]); + data[i] = static_cast(std::tolower(static_cast(str[i]))); if (data[i] == '\\') data[i] = '/'; } @@ -2790,3 +2795,7 @@ struct __init__ __init__ _; } // namespace xsk::gsc::h2 + +#ifdef _MSC_VER +#pragma warning(pop) +#endif diff --git a/src/iw5/stdafx.hpp b/src/iw5/stdafx.hpp index 749be8fa..19f22f43 100644 --- a/src/iw5/stdafx.hpp +++ b/src/iw5/stdafx.hpp @@ -5,39 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4005) -#pragma warning(disable:4018) -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4389) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include -// Ext using namespace std::literals; - -#include "xsk/iw5.hpp" diff --git a/src/iw5/xsk/assembler.cpp b/src/iw5/xsk/assembler.cpp index 557340c1..453f152a 100644 --- a/src/iw5/xsk/assembler.cpp +++ b/src/iw5/xsk/assembler.cpp @@ -144,7 +144,7 @@ void assembler::assemble_function(const function::ptr& func) func->id = resolver::token_id(func->name); stack_->write(func->size); - stack_->write(func->id); + stack_->write(static_cast(func->id)); if (func->id == 0) { @@ -452,7 +452,7 @@ void assembler::assemble_end_switch(const instruction::ptr& inst) const auto count = std::stoul(inst->data[0]); - script_->write(count); + script_->write(static_cast(count)); std::uint32_t index = inst->index + 3; @@ -519,15 +519,15 @@ void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back if (expr) { - script_->write(addr - inst->index - 3); + script_->write(static_cast(addr - inst->index - 3)); } else if (back) { - script_->write((inst->index + 3) - addr); + script_->write(static_cast((inst->index + 3) - addr)); } else { - script_->write(addr - inst->index - 5); + script_->write(static_cast(addr - inst->index - 5)); } } @@ -546,11 +546,11 @@ void assembler::assemble_offset(std::int32_t offset) auto assembler::resolve_function(const std::string& name) -> std::int32_t { - for (const auto& func : functions_) + for (const auto& entry : functions_) { - if (func->name == name) + if (entry->name == name) { - return func->index; + return entry->index; } } @@ -559,11 +559,11 @@ auto assembler::resolve_function(const std::string& name) -> std::int32_t auto assembler::resolve_label(const std::string& name) -> std::int32_t { - for (const auto& func : labels_) + for (const auto& entry : labels_) { - if (func.second == name) + if (entry.second == name) { - return func.first; + return entry.first; } } diff --git a/src/iw5/xsk/compiler.cpp b/src/iw5/xsk/compiler.cpp index 79e6d408..8f1322c0 100644 --- a/src/iw5/xsk/compiler.cpp +++ b/src/iw5/xsk/compiler.cpp @@ -840,7 +840,7 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: emit_opcode(opcode::OP_endswitch, data); - auto offset = 7 * stmt->stmt->list.size(); + auto offset = static_cast(7 * stmt->stmt->list.size()); function_->instructions.back()->size += offset; index_ += offset; @@ -2660,7 +2660,7 @@ auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const { if (blk->local_vars.at(i).init) { - return blk->local_vars_create_count - 1 - i; + return static_cast(blk->local_vars_create_count - 1 - i); } throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); diff --git a/src/iw5/xsk/decompiler.cpp b/src/iw5/xsk/decompiler.cpp index 8f330cab..5fbe391f 100644 --- a/src/iw5/xsk/decompiler.cpp +++ b/src/iw5/xsk/decompiler.cpp @@ -1781,7 +1781,7 @@ void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) void decompiler::decompile_infinites(const ast::stmt_list::ptr& stmt) { - for (int i = stmt->list.size() - 1; i >= 0; i--) + for (auto i = stmt->list.size() - 1; i > 0; i--) { if (stmt->list.at(i) == ast::kind::asm_jump_back) { @@ -1944,7 +1944,7 @@ void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) } } -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_end = stmt->list.at(begin).as_cond->value; @@ -1972,7 +1972,7 @@ void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t beg stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.loc_end = stmt->list.at(end).loc().label(); @@ -2023,7 +2023,7 @@ void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.is_last = true; @@ -2083,7 +2083,7 @@ void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uin } } -void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); @@ -2113,7 +2113,7 @@ void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32 stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t start, std::uint32_t end) +void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::size_t start, std::size_t end) { auto& last = block->list.at(end - 1); @@ -2178,7 +2178,7 @@ void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t decompile_while(block, start, end); } -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2208,7 +2208,7 @@ void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2239,7 +2239,7 @@ void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2293,7 +2293,7 @@ void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t be stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2360,7 +2360,7 @@ void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t start) +void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) { block blk; blk.loc_continue = blocks_.back().loc_continue; @@ -2473,7 +2473,7 @@ void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); } -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool +auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool { for (auto i = begin; i < end; i++) { @@ -2492,7 +2492,7 @@ auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::u return false; } -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t +auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t { auto index = 0u; @@ -2510,7 +2510,7 @@ auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std: throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); } -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool +auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool { if (index == stmt->list.size() - 1) return true; @@ -3328,7 +3328,7 @@ void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) { - blk->local_vars_public_count = blk->local_vars.size() - std::stoi(expr->index); + blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); } } // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/decompiler.hpp b/src/iw5/xsk/decompiler.hpp index 7e56762c..9b973206 100644 --- a/src/iw5/xsk/decompiler.hpp +++ b/src/iw5/xsk/decompiler.hpp @@ -34,19 +34,19 @@ private: void decompile_switches(const ast::stmt_list::ptr& stmt); void decompile_ifelses(const ast::stmt_list::ptr& stmt); void decompile_aborts(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool; + void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); + auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; + auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; + auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; void process_stack(const ast::decl_thread::ptr& thread); void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); void process_stmt(const ast::stmt& stmt, const block::ptr& blk); diff --git a/src/iw5/xsk/disassembler.cpp b/src/iw5/xsk/disassembler.cpp index 55f06c66..588d746d 100644 --- a/src/iw5/xsk/disassembler.cpp +++ b/src/iw5/xsk/disassembler.cpp @@ -51,7 +51,7 @@ void disassembler::disassemble(const std::string& file, std::vectorindex = static_cast(script_->pos()); func->size = stack_->read(); func->id = stack_->read(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id); + func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); dissasemble_function(func); diff --git a/src/iw5/xsk/lexer.cpp b/src/iw5/xsk/lexer.cpp index 88a5f8e6..33a3ca0b 100644 --- a/src/iw5/xsk/lexer.cpp +++ b/src/iw5/xsk/lexer.cpp @@ -96,7 +96,7 @@ void reader::init(const char* data, size_t size) { state = reader::ok; buffer_pos = data; - bytes_remaining = size; + bytes_remaining = static_cast(size); last_byte = 0; current_byte = *data; } diff --git a/src/iw5/xsk/parser.cpp b/src/iw5/xsk/parser.cpp index edd17e94..9e1e8a3b 100644 --- a/src/iw5/xsk/parser.cpp +++ b/src/iw5/xsk/parser.cpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -35,7 +35,7 @@ // private implementation details that can be changed or removed. // "%code top" blocks. -#line 34 "parser.ypp" +#line 38 "parser.ypp" #include "stdafx.hpp" #include "parser.hpp" @@ -166,9 +166,9 @@ namespace xsk { namespace gsc { namespace iw5 { parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -1451,7 +1451,7 @@ namespace xsk { namespace gsc { namespace iw5 { } void - parser::yypop_ (int n) + parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -1494,13 +1494,13 @@ namespace xsk { namespace gsc { namespace iw5 { } bool - parser::yy_pact_value_is_default_ (int yyvalue) + parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - parser::yy_table_value_is_error_ (int yyvalue) + parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -1531,8 +1531,8 @@ namespace xsk { namespace gsc { namespace iw5 { /// The return value of parse (). int yyresult; - /// Discard the LAC context in case there still is one left from a - /// previous invocation. + // Discard the LAC context in case there still is one left from a + // previous invocation. yy_lac_discard_ ("init"); #if YY_EXCEPTIONS @@ -1610,7 +1610,7 @@ namespace xsk { namespace gsc { namespace iw5 { if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) { if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; goto yydefault; } @@ -1621,7 +1621,7 @@ namespace xsk { namespace gsc { namespace iw5 { if (yy_table_value_is_error_ (yyn)) goto yyerrlab; if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -1964,1297 +1964,1297 @@ namespace xsk { namespace gsc { namespace iw5 { switch (yyn) { case 2: // root: program -#line 253 "parser.ypp" +#line 257 "parser.ypp" { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } #line 1970 "parser.cpp" break; case 3: // root: %empty -#line 254 "parser.ypp" +#line 258 "parser.ypp" { ast = std::make_unique(yylhs.location); } #line 1976 "parser.cpp" break; case 4: // program: program inline -#line 259 "parser.ypp" +#line 263 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } #line 1982 "parser.cpp" break; case 5: // program: program include -#line 261 "parser.ypp" +#line 265 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 1988 "parser.cpp" break; case 6: // program: program declaration -#line 263 "parser.ypp" +#line 267 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 1994 "parser.cpp" break; case 7: // program: inline -#line 265 "parser.ypp" +#line 269 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } #line 2000 "parser.cpp" break; case 8: // program: include -#line 267 "parser.ypp" +#line 271 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2006 "parser.cpp" break; case 9: // program: declaration -#line 269 "parser.ypp" +#line 273 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2012 "parser.cpp" break; case 10: // inline: "#inline" expr_path ";" -#line 273 "parser.ypp" +#line 277 "parser.ypp" { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } #line 2018 "parser.cpp" break; case 11: // include: "#include" expr_path ";" -#line 278 "parser.ypp" +#line 282 "parser.ypp" { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } #line 2024 "parser.cpp" break; case 12: // declaration: "/#" -#line 282 "parser.ypp" +#line 286 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } #line 2030 "parser.cpp" break; case 13: // declaration: "#/" -#line 283 "parser.ypp" +#line 287 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } #line 2036 "parser.cpp" break; case 14: // declaration: decl_usingtree -#line 284 "parser.ypp" +#line 288 "parser.ypp" { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } #line 2042 "parser.cpp" break; case 15: // declaration: decl_constant -#line 285 "parser.ypp" +#line 289 "parser.ypp" { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } #line 2048 "parser.cpp" break; case 16: // declaration: decl_thread -#line 286 "parser.ypp" +#line 290 "parser.ypp" { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } #line 2054 "parser.cpp" break; case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 291 "parser.ypp" +#line 295 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_usingtree::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_string::ptr > ())); } #line 2060 "parser.cpp" break; case 18: // decl_constant: expr_identifier "=" expr ";" -#line 296 "parser.ypp" +#line 300 "parser.ypp" { yylhs.value.as < ast::decl_constant::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 2066 "parser.cpp" break; case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 301 "parser.ypp" +#line 305 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2072 "parser.cpp" break; case 20: // stmt: stmt_block -#line 305 "parser.ypp" +#line 309 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } #line 2078 "parser.cpp" break; case 21: // stmt: stmt_call -#line 306 "parser.ypp" +#line 310 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } #line 2084 "parser.cpp" break; case 22: // stmt: stmt_assign -#line 307 "parser.ypp" +#line 311 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } #line 2090 "parser.cpp" break; case 23: // stmt: stmt_endon -#line 308 "parser.ypp" +#line 312 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } #line 2096 "parser.cpp" break; case 24: // stmt: stmt_notify -#line 309 "parser.ypp" +#line 313 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } #line 2102 "parser.cpp" break; case 25: // stmt: stmt_wait -#line 310 "parser.ypp" +#line 314 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } #line 2108 "parser.cpp" break; case 26: // stmt: stmt_waittill -#line 311 "parser.ypp" +#line 315 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } #line 2114 "parser.cpp" break; case 27: // stmt: stmt_waittillmatch -#line 312 "parser.ypp" +#line 316 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } #line 2120 "parser.cpp" break; case 28: // stmt: stmt_waittillframeend -#line 313 "parser.ypp" +#line 317 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } #line 2126 "parser.cpp" break; case 29: // stmt: stmt_if -#line 314 "parser.ypp" +#line 318 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } #line 2132 "parser.cpp" break; case 30: // stmt: stmt_ifelse -#line 315 "parser.ypp" +#line 319 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } #line 2138 "parser.cpp" break; case 31: // stmt: stmt_while -#line 316 "parser.ypp" +#line 320 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } #line 2144 "parser.cpp" break; case 32: // stmt: stmt_dowhile -#line 317 "parser.ypp" +#line 321 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } #line 2150 "parser.cpp" break; case 33: // stmt: stmt_for -#line 318 "parser.ypp" +#line 322 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } #line 2156 "parser.cpp" break; case 34: // stmt: stmt_foreach -#line 319 "parser.ypp" +#line 323 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } #line 2162 "parser.cpp" break; case 35: // stmt: stmt_switch -#line 320 "parser.ypp" +#line 324 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } #line 2168 "parser.cpp" break; case 36: // stmt: stmt_case -#line 321 "parser.ypp" +#line 325 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } #line 2174 "parser.cpp" break; case 37: // stmt: stmt_default -#line 322 "parser.ypp" +#line 326 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } #line 2180 "parser.cpp" break; case 38: // stmt: stmt_break -#line 323 "parser.ypp" +#line 327 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } #line 2186 "parser.cpp" break; case 39: // stmt: stmt_continue -#line 324 "parser.ypp" +#line 328 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } #line 2192 "parser.cpp" break; case 40: // stmt: stmt_return -#line 325 "parser.ypp" +#line 329 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } #line 2198 "parser.cpp" break; case 41: // stmt: stmt_breakpoint -#line 326 "parser.ypp" +#line 330 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } #line 2204 "parser.cpp" break; case 42: // stmt: stmt_prof_begin -#line 327 "parser.ypp" +#line 331 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } #line 2210 "parser.cpp" break; case 43: // stmt: stmt_prof_end -#line 328 "parser.ypp" +#line 332 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } #line 2216 "parser.cpp" break; case 44: // stmt_or_dev: stmt -#line 332 "parser.ypp" +#line 336 "parser.ypp" { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } #line 2222 "parser.cpp" break; case 45: // stmt_or_dev: stmt_dev -#line 333 "parser.ypp" +#line 337 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } #line 2228 "parser.cpp" break; case 46: // stmt_list: stmt_list stmt -#line 338 "parser.ypp" +#line 342 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2234 "parser.cpp" break; case 47: // stmt_list: stmt -#line 340 "parser.ypp" +#line 344 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2240 "parser.cpp" break; case 48: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 345 "parser.ypp" +#line 349 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2246 "parser.cpp" break; case 49: // stmt_or_dev_list: stmt_or_dev -#line 347 "parser.ypp" +#line 351 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2252 "parser.cpp" break; case 50: // stmt_dev: "/#" stmt_list "#/" -#line 351 "parser.ypp" +#line 355 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::stmt_list::ptr > ())); } #line 2258 "parser.cpp" break; case 51: // stmt_dev: "/#" "#/" -#line 352 "parser.ypp" +#line 356 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2264 "parser.cpp" break; case 52: // stmt_block: "{" stmt_or_dev_list "}" -#line 356 "parser.ypp" +#line 360 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } #line 2270 "parser.cpp" break; case 53: // stmt_block: "{" "}" -#line 357 "parser.ypp" +#line 361 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } #line 2276 "parser.cpp" break; case 54: // stmt_expr: expr_assign -#line 362 "parser.ypp" +#line 366 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2282 "parser.cpp" break; case 55: // stmt_expr: expr_increment -#line 364 "parser.ypp" +#line 368 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2288 "parser.cpp" break; case 56: // stmt_expr: expr_decrement -#line 366 "parser.ypp" +#line 370 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2294 "parser.cpp" break; case 57: // stmt_expr: %empty -#line 368 "parser.ypp" +#line 372 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2300 "parser.cpp" break; case 58: // stmt_call: expr_call ";" -#line 373 "parser.ypp" +#line 377 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_call::ptr > ()))); } #line 2306 "parser.cpp" break; case 59: // stmt_call: expr_method ";" -#line 375 "parser.ypp" +#line 379 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_method::ptr > ()))); } #line 2312 "parser.cpp" break; case 60: // stmt_assign: expr_assign ";" -#line 380 "parser.ypp" +#line 384 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2318 "parser.cpp" break; case 61: // stmt_assign: expr_increment ";" -#line 382 "parser.ypp" +#line 386 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2324 "parser.cpp" break; case 62: // stmt_assign: expr_decrement ";" -#line 384 "parser.ypp" +#line 388 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2330 "parser.cpp" break; case 63: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 389 "parser.ypp" +#line 393 "parser.ypp" { yylhs.value.as < ast::stmt_endon::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ())); } #line 2336 "parser.cpp" break; case 64: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 394 "parser.ypp" +#line 398 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2342 "parser.cpp" break; case 65: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 396 "parser.ypp" +#line 400 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2348 "parser.cpp" break; case 66: // stmt_wait: "wait" expr ";" -#line 401 "parser.ypp" +#line 405 "parser.ypp" { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2354 "parser.cpp" break; case 67: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 406 "parser.ypp" +#line 410 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2360 "parser.cpp" break; case 68: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 408 "parser.ypp" +#line 412 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2366 "parser.cpp" break; case 69: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 413 "parser.ypp" +#line 417 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2372 "parser.cpp" break; case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 415 "parser.ypp" +#line 419 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2378 "parser.cpp" break; case 71: // stmt_waittillframeend: "waittillframeend" ";" -#line 420 "parser.ypp" +#line 424 "parser.ypp" { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } #line 2384 "parser.cpp" break; case 72: // stmt_if: "if" "(" expr ")" stmt -#line 425 "parser.ypp" +#line 429 "parser.ypp" { yylhs.value.as < ast::stmt_if::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2390 "parser.cpp" break; case 73: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 430 "parser.ypp" +#line 434 "parser.ypp" { yylhs.value.as < ast::stmt_ifelse::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::stmt > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2396 "parser.cpp" break; case 74: // stmt_while: "while" "(" expr ")" stmt -#line 435 "parser.ypp" +#line 439 "parser.ypp" { yylhs.value.as < ast::stmt_while::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2402 "parser.cpp" break; case 75: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 440 "parser.ypp" +#line 444 "parser.ypp" { yylhs.value.as < ast::stmt_dowhile::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[5].value.as < ast::stmt > ())); } #line 2408 "parser.cpp" break; case 76: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 445 "parser.ypp" +#line 449 "parser.ypp" { yylhs.value.as < ast::stmt_for::ptr > () = std::make_unique(yylhs.location, ast::stmt(std::move(yystack_[6].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[4].value.as < ast::expr > ()), ast::stmt(std::move(yystack_[2].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2414 "parser.cpp" break; case 77: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 450 "parser.ypp" +#line 454 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2420 "parser.cpp" break; case 78: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 452 "parser.ypp" +#line 456 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[6].value.as < ast::expr_identifier::ptr > ())), ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2426 "parser.cpp" break; case 79: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 457 "parser.ypp" +#line 461 "parser.ypp" { yylhs.value.as < ast::stmt_switch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2432 "parser.cpp" break; case 80: // stmt_case: "case" expr_integer ":" -#line 462 "parser.ypp" +#line 466 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_integer::ptr > ())), std::make_unique(yylhs.location)); } #line 2438 "parser.cpp" break; case 81: // stmt_case: "case" expr_string ":" -#line 464 "parser.ypp" +#line 468 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_string::ptr > ())), std::make_unique(yylhs.location)); } #line 2444 "parser.cpp" break; case 82: // stmt_default: "default" ":" -#line 469 "parser.ypp" +#line 473 "parser.ypp" { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2450 "parser.cpp" break; case 83: // stmt_break: "break" ";" -#line 474 "parser.ypp" +#line 478 "parser.ypp" { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } #line 2456 "parser.cpp" break; case 84: // stmt_continue: "continue" ";" -#line 479 "parser.ypp" +#line 483 "parser.ypp" { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } #line 2462 "parser.cpp" break; case 85: // stmt_return: "return" expr ";" -#line 484 "parser.ypp" +#line 488 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2468 "parser.cpp" break; case 86: // stmt_return: "return" ";" -#line 486 "parser.ypp" +#line 490 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2474 "parser.cpp" break; case 87: // stmt_breakpoint: "breakpoint" ";" -#line 491 "parser.ypp" +#line 495 "parser.ypp" { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } #line 2480 "parser.cpp" break; case 88: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 496 "parser.ypp" +#line 500 "parser.ypp" { yylhs.value.as < ast::stmt_prof_begin::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2486 "parser.cpp" break; case 89: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 501 "parser.ypp" +#line 505 "parser.ypp" { yylhs.value.as < ast::stmt_prof_end::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2492 "parser.cpp" break; case 90: // expr: expr_ternary -#line 505 "parser.ypp" +#line 509 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2498 "parser.cpp" break; case 91: // expr: expr_binary -#line 506 "parser.ypp" +#line 510 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2504 "parser.cpp" break; case 92: // expr: expr_primitive -#line 507 "parser.ypp" +#line 511 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2510 "parser.cpp" break; case 93: // expr_or_empty: expr -#line 511 "parser.ypp" +#line 515 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2516 "parser.cpp" break; case 94: // expr_or_empty: %empty -#line 512 "parser.ypp" +#line 516 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } #line 2522 "parser.cpp" break; case 95: // expr_assign: expr_object "=" expr -#line 517 "parser.ypp" +#line 521 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2528 "parser.cpp" break; case 96: // expr_assign: expr_object "|=" expr -#line 519 "parser.ypp" +#line 523 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2534 "parser.cpp" break; case 97: // expr_assign: expr_object "&=" expr -#line 521 "parser.ypp" +#line 525 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2540 "parser.cpp" break; case 98: // expr_assign: expr_object "^=" expr -#line 523 "parser.ypp" +#line 527 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2546 "parser.cpp" break; case 99: // expr_assign: expr_object "<<=" expr -#line 525 "parser.ypp" +#line 529 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()),std::move( yystack_[0].value.as < ast::expr > ())); } #line 2552 "parser.cpp" break; case 100: // expr_assign: expr_object ">>=" expr -#line 527 "parser.ypp" +#line 531 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2558 "parser.cpp" break; case 101: // expr_assign: expr_object "+=" expr -#line 529 "parser.ypp" +#line 533 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2564 "parser.cpp" break; case 102: // expr_assign: expr_object "-=" expr -#line 531 "parser.ypp" +#line 535 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2570 "parser.cpp" break; case 103: // expr_assign: expr_object "*=" expr -#line 533 "parser.ypp" +#line 537 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2576 "parser.cpp" break; case 104: // expr_assign: expr_object "/=" expr -#line 535 "parser.ypp" +#line 539 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2582 "parser.cpp" break; case 105: // expr_assign: expr_object "%=" expr -#line 537 "parser.ypp" +#line 541 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2588 "parser.cpp" break; case 106: // expr_increment: "++" expr_object -#line 542 "parser.ypp" +#line 546 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2594 "parser.cpp" break; case 107: // expr_increment: expr_object "++" -#line 544 "parser.ypp" +#line 548 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2600 "parser.cpp" break; case 108: // expr_decrement: "--" expr_object -#line 549 "parser.ypp" +#line 553 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2606 "parser.cpp" break; case 109: // expr_decrement: expr_object "--" -#line 551 "parser.ypp" +#line 555 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2612 "parser.cpp" break; case 110: // expr_ternary: expr "?" expr ":" expr -#line 556 "parser.ypp" +#line 560 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2618 "parser.cpp" break; case 111: // expr_binary: expr "||" expr -#line 561 "parser.ypp" +#line 565 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2624 "parser.cpp" break; case 112: // expr_binary: expr "&&" expr -#line 563 "parser.ypp" +#line 567 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2630 "parser.cpp" break; case 113: // expr_binary: expr "==" expr -#line 565 "parser.ypp" +#line 569 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2636 "parser.cpp" break; case 114: // expr_binary: expr "!=" expr -#line 567 "parser.ypp" +#line 571 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2642 "parser.cpp" break; case 115: // expr_binary: expr "<=" expr -#line 569 "parser.ypp" +#line 573 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2648 "parser.cpp" break; case 116: // expr_binary: expr ">=" expr -#line 571 "parser.ypp" +#line 575 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2654 "parser.cpp" break; case 117: // expr_binary: expr "<" expr -#line 573 "parser.ypp" +#line 577 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2660 "parser.cpp" break; case 118: // expr_binary: expr ">" expr -#line 575 "parser.ypp" +#line 579 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2666 "parser.cpp" break; case 119: // expr_binary: expr "|" expr -#line 577 "parser.ypp" +#line 581 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2672 "parser.cpp" break; case 120: // expr_binary: expr "&" expr -#line 579 "parser.ypp" +#line 583 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2678 "parser.cpp" break; case 121: // expr_binary: expr "^" expr -#line 581 "parser.ypp" +#line 585 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2684 "parser.cpp" break; case 122: // expr_binary: expr "<<" expr -#line 583 "parser.ypp" +#line 587 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2690 "parser.cpp" break; case 123: // expr_binary: expr ">>" expr -#line 585 "parser.ypp" +#line 589 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2696 "parser.cpp" break; case 124: // expr_binary: expr "+" expr -#line 587 "parser.ypp" +#line 591 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2702 "parser.cpp" break; case 125: // expr_binary: expr "-" expr -#line 589 "parser.ypp" +#line 593 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2708 "parser.cpp" break; case 126: // expr_binary: expr "*" expr -#line 591 "parser.ypp" +#line 595 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2714 "parser.cpp" break; case 127: // expr_binary: expr "/" expr -#line 593 "parser.ypp" +#line 597 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2720 "parser.cpp" break; case 128: // expr_binary: expr "%" expr -#line 595 "parser.ypp" +#line 599 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2726 "parser.cpp" break; case 129: // expr_primitive: expr_complement -#line 599 "parser.ypp" +#line 603 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } #line 2732 "parser.cpp" break; case 130: // expr_primitive: expr_not -#line 600 "parser.ypp" +#line 604 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } #line 2738 "parser.cpp" break; case 131: // expr_primitive: expr_call -#line 601 "parser.ypp" +#line 605 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 2744 "parser.cpp" break; case 132: // expr_primitive: expr_method -#line 602 "parser.ypp" +#line 606 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 2750 "parser.cpp" break; case 133: // expr_primitive: expr_add_array -#line 603 "parser.ypp" +#line 607 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } #line 2756 "parser.cpp" break; case 134: // expr_primitive: expr_reference -#line 604 "parser.ypp" +#line 608 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } #line 2762 "parser.cpp" break; case 135: // expr_primitive: expr_array -#line 605 "parser.ypp" +#line 609 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 2768 "parser.cpp" break; case 136: // expr_primitive: expr_field -#line 606 "parser.ypp" +#line 610 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 2774 "parser.cpp" break; case 137: // expr_primitive: expr_size -#line 607 "parser.ypp" +#line 611 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } #line 2780 "parser.cpp" break; case 138: // expr_primitive: expr_paren -#line 608 "parser.ypp" +#line 612 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } #line 2786 "parser.cpp" break; case 139: // expr_primitive: expr_thisthread -#line 609 "parser.ypp" +#line 613 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } #line 2792 "parser.cpp" break; case 140: // expr_primitive: expr_empty_array -#line 610 "parser.ypp" +#line 614 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } #line 2798 "parser.cpp" break; case 141: // expr_primitive: expr_undefined -#line 611 "parser.ypp" +#line 615 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } #line 2804 "parser.cpp" break; case 142: // expr_primitive: expr_game -#line 612 "parser.ypp" +#line 616 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 2810 "parser.cpp" break; case 143: // expr_primitive: expr_self -#line 613 "parser.ypp" +#line 617 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 2816 "parser.cpp" break; case 144: // expr_primitive: expr_anim -#line 614 "parser.ypp" +#line 618 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 2822 "parser.cpp" break; case 145: // expr_primitive: expr_level -#line 615 "parser.ypp" +#line 619 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 2828 "parser.cpp" break; case 146: // expr_primitive: expr_animation -#line 616 "parser.ypp" +#line 620 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } #line 2834 "parser.cpp" break; case 147: // expr_primitive: expr_animtree -#line 617 "parser.ypp" +#line 621 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } #line 2840 "parser.cpp" break; case 148: // expr_primitive: expr_identifier -#line 618 "parser.ypp" +#line 622 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 2846 "parser.cpp" break; case 149: // expr_primitive: expr_istring -#line 619 "parser.ypp" +#line 623 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } #line 2852 "parser.cpp" break; case 150: // expr_primitive: expr_string -#line 620 "parser.ypp" +#line 624 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } #line 2858 "parser.cpp" break; case 151: // expr_primitive: expr_vector -#line 621 "parser.ypp" +#line 625 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } #line 2864 "parser.cpp" break; case 152: // expr_primitive: expr_float -#line 622 "parser.ypp" +#line 626 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } #line 2870 "parser.cpp" break; case 153: // expr_primitive: expr_integer -#line 623 "parser.ypp" +#line 627 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } #line 2876 "parser.cpp" break; case 154: // expr_primitive: expr_false -#line 624 "parser.ypp" +#line 628 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } #line 2882 "parser.cpp" break; case 155: // expr_primitive: expr_true -#line 625 "parser.ypp" +#line 629 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } #line 2888 "parser.cpp" break; case 156: // expr_complement: "~" expr -#line 630 "parser.ypp" +#line 634 "parser.ypp" { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2894 "parser.cpp" break; case 157: // expr_not: "!" expr -#line 635 "parser.ypp" +#line 639 "parser.ypp" { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2900 "parser.cpp" break; case 158: // expr_call: expr_function -#line 639 "parser.ypp" +#line 643 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2906 "parser.cpp" break; case 159: // expr_call: expr_pointer -#line 640 "parser.ypp" +#line 644 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2912 "parser.cpp" break; case 160: // expr_method: expr_object expr_function -#line 643 "parser.ypp" +#line 647 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 2918 "parser.cpp" break; case 161: // expr_method: expr_object expr_pointer -#line 644 "parser.ypp" +#line 648 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 2924 "parser.cpp" break; case 162: // expr_function: expr_identifier "(" expr_arguments ")" -#line 649 "parser.ypp" +#line 653 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2930 "parser.cpp" break; case 163: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 651 "parser.ypp" +#line 655 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2936 "parser.cpp" break; case 164: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 653 "parser.ypp" +#line 657 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2942 "parser.cpp" break; case 165: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 655 "parser.ypp" +#line 659 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2948 "parser.cpp" break; case 166: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 657 "parser.ypp" +#line 661 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2954 "parser.cpp" break; case 167: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 659 "parser.ypp" +#line 663 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2960 "parser.cpp" break; case 168: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 664 "parser.ypp" +#line 668 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2966 "parser.cpp" break; case 169: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 666 "parser.ypp" +#line 670 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2972 "parser.cpp" break; case 170: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 668 "parser.ypp" +#line 672 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2978 "parser.cpp" break; case 171: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 670 "parser.ypp" +#line 674 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::builtin); } #line 2984 "parser.cpp" break; case 172: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 675 "parser.ypp" +#line 679 "parser.ypp" { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } #line 2990 "parser.cpp" break; case 173: // expr_parameters: expr_parameters "," expr_identifier -#line 680 "parser.ypp" +#line 684 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 2996 "parser.cpp" break; case 174: // expr_parameters: expr_identifier -#line 682 "parser.ypp" +#line 686 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3002 "parser.cpp" break; case 175: // expr_parameters: %empty -#line 684 "parser.ypp" +#line 688 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } #line 3008 "parser.cpp" break; case 176: // expr_arguments: expr_arguments_no_empty -#line 689 "parser.ypp" +#line 693 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } #line 3014 "parser.cpp" break; case 177: // expr_arguments: %empty -#line 691 "parser.ypp" +#line 695 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } #line 3020 "parser.cpp" break; case 178: // expr_arguments_no_empty: expr_arguments "," expr -#line 696 "parser.ypp" +#line 700 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ()); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3026 "parser.cpp" break; case 179: // expr_arguments_no_empty: expr -#line 698 "parser.ypp" +#line 702 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3032 "parser.cpp" break; case 180: // expr_reference: "::" expr_identifier -#line 703 "parser.ypp" +#line 707 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3038 "parser.cpp" break; case 181: // expr_reference: expr_path "::" expr_identifier -#line 705 "parser.ypp" +#line 709 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_path::ptr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3044 "parser.cpp" break; case 182: // expr_array: expr_object "[" expr "]" -#line 710 "parser.ypp" +#line 714 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3050 "parser.cpp" break; case 183: // expr_field: expr_object "." expr_identifier_nosize -#line 715 "parser.ypp" +#line 719 "parser.ypp" { yylhs.value.as < ast::expr_field::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3056 "parser.cpp" break; case 184: // expr_size: expr_object "." "size" -#line 720 "parser.ypp" +#line 724 "parser.ypp" { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } #line 3062 "parser.cpp" break; case 185: // expr_paren: "(" expr ")" -#line 725 "parser.ypp" +#line 729 "parser.ypp" { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3068 "parser.cpp" break; case 186: // expr_object: expr_call -#line 729 "parser.ypp" +#line 733 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 3074 "parser.cpp" break; case 187: // expr_object: expr_method -#line 730 "parser.ypp" +#line 734 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 3080 "parser.cpp" break; case 188: // expr_object: expr_array -#line 731 "parser.ypp" +#line 735 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 3086 "parser.cpp" break; case 189: // expr_object: expr_field -#line 732 "parser.ypp" +#line 736 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 3092 "parser.cpp" break; case 190: // expr_object: expr_game -#line 733 "parser.ypp" +#line 737 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 3098 "parser.cpp" break; case 191: // expr_object: expr_self -#line 734 "parser.ypp" +#line 738 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 3104 "parser.cpp" break; case 192: // expr_object: expr_anim -#line 735 "parser.ypp" +#line 739 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 3110 "parser.cpp" break; case 193: // expr_object: expr_level -#line 736 "parser.ypp" +#line 740 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 3116 "parser.cpp" break; case 194: // expr_object: expr_identifier -#line 737 "parser.ypp" +#line 741 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 3122 "parser.cpp" break; case 195: // expr_thisthread: "thisthread" -#line 742 "parser.ypp" +#line 746 "parser.ypp" { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } #line 3128 "parser.cpp" break; case 196: // expr_empty_array: "[" "]" -#line 747 "parser.ypp" +#line 751 "parser.ypp" { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } #line 3134 "parser.cpp" break; case 197: // expr_undefined: "undefined" -#line 752 "parser.ypp" +#line 756 "parser.ypp" { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } #line 3140 "parser.cpp" break; case 198: // expr_game: "game" -#line 757 "parser.ypp" +#line 761 "parser.ypp" { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } #line 3146 "parser.cpp" break; case 199: // expr_self: "self" -#line 762 "parser.ypp" +#line 766 "parser.ypp" { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } #line 3152 "parser.cpp" break; case 200: // expr_anim: "anim" -#line 767 "parser.ypp" +#line 771 "parser.ypp" { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } #line 3158 "parser.cpp" break; case 201: // expr_level: "level" -#line 772 "parser.ypp" +#line 776 "parser.ypp" { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } #line 3164 "parser.cpp" break; case 202: // expr_animation: "%" "identifier" -#line 777 "parser.ypp" +#line 781 "parser.ypp" { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3170 "parser.cpp" break; case 203: // expr_animtree: "#animtree" -#line 782 "parser.ypp" +#line 786 "parser.ypp" { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } #line 3176 "parser.cpp" break; case 204: // expr_identifier_nosize: "identifier" -#line 787 "parser.ypp" +#line 791 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3182 "parser.cpp" break; case 205: // expr_identifier: "identifier" -#line 792 "parser.ypp" +#line 796 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3188 "parser.cpp" break; case 206: // expr_identifier: "size" -#line 794 "parser.ypp" +#line 798 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } #line 3194 "parser.cpp" break; case 207: // expr_path: "identifier" -#line 799 "parser.ypp" +#line 803 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3200 "parser.cpp" break; case 208: // expr_path: "path" -#line 801 "parser.ypp" +#line 805 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3206 "parser.cpp" break; case 209: // expr_istring: "localized string" -#line 806 "parser.ypp" +#line 810 "parser.ypp" { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3212 "parser.cpp" break; case 210: // expr_string: "string literal" -#line 811 "parser.ypp" +#line 815 "parser.ypp" { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3218 "parser.cpp" break; case 211: // expr_vector: "(" expr "," expr "," expr ")" -#line 816 "parser.ypp" +#line 820 "parser.ypp" { yylhs.value.as < ast::expr_vector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3224 "parser.cpp" break; case 212: // expr_float: "-" "float" -#line 821 "parser.ypp" +#line 825 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3230 "parser.cpp" break; case 213: // expr_float: "float" -#line 823 "parser.ypp" +#line 827 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3236 "parser.cpp" break; case 214: // expr_integer: "-" "integer" -#line 828 "parser.ypp" +#line 832 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3242 "parser.cpp" break; case 215: // expr_integer: "integer" -#line 830 "parser.ypp" +#line 834 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3248 "parser.cpp" break; case 216: // expr_false: "false" -#line 835 "parser.ypp" +#line 839 "parser.ypp" { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } #line 3254 "parser.cpp" break; case 217: // expr_true: "true" -#line 840 "parser.ypp" +#line 844 "parser.ypp" { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } #line 3260 "parser.cpp" break; @@ -3523,6 +3523,8 @@ namespace xsk { namespace gsc { namespace iw5 { } + + bool parser::yy_lac_check_ (symbol_kind_type yytoken) const { @@ -3627,7 +3629,9 @@ namespace xsk { namespace gsc { namespace iw5 { follows. If no initial context is currently established for the current lookahead, then check if that lookahead can eventually be shifted if syntactic actions continue from the current context. */ - if (!yy_lac_established_) + if (yy_lac_established_) + return true; + else { #if IW5DEBUG YYCDEBUG << "LAC: initial context established for " @@ -3636,12 +3640,11 @@ namespace xsk { namespace gsc { namespace iw5 { yy_lac_established_ = true; return yy_lac_check_ (yytoken); } - return true; } // Discard any previous initial lookahead context. void - parser::yy_lac_discard_ (const char* evt) + parser::yy_lac_discard_ (const char* event) { /* Discard any previous initial lookahead context because of Event, which may be a lookahead change or an invalidation of the currently @@ -3657,11 +3660,12 @@ namespace xsk { namespace gsc { namespace iw5 { if (yy_lac_established_) { YYCDEBUG << "LAC: initial context discarded due to " - << evt << '\n'; + << event << '\n'; yy_lac_established_ = false; } } + int parser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -4453,28 +4457,28 @@ namespace xsk { namespace gsc { namespace iw5 { const short parser::yyrline_[] = { - 0, 253, 253, 254, 258, 260, 262, 264, 266, 268, - 273, 277, 282, 283, 284, 285, 286, 290, 295, 300, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 332, 333, 337, 339, 344, 346, - 351, 352, 356, 357, 361, 363, 365, 368, 372, 374, - 379, 381, 383, 388, 393, 395, 400, 405, 407, 412, - 414, 419, 424, 429, 434, 439, 444, 449, 451, 456, - 461, 463, 468, 473, 478, 483, 485, 490, 495, 500, - 505, 506, 507, 511, 512, 516, 518, 520, 522, 524, - 526, 528, 530, 532, 534, 536, 541, 543, 548, 550, - 555, 560, 562, 564, 566, 568, 570, 572, 574, 576, - 578, 580, 582, 584, 586, 588, 590, 592, 594, 599, - 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, - 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, - 620, 621, 622, 623, 624, 625, 629, 634, 639, 640, - 643, 644, 648, 650, 652, 654, 656, 658, 663, 665, - 667, 669, 674, 679, 681, 684, 688, 691, 695, 697, - 702, 704, 709, 714, 719, 724, 729, 730, 731, 732, - 733, 734, 735, 736, 737, 741, 746, 751, 756, 761, - 766, 771, 776, 781, 786, 791, 793, 798, 800, 805, - 810, 815, 820, 822, 827, 829, 834, 839 + 0, 257, 257, 258, 262, 264, 266, 268, 270, 272, + 277, 281, 286, 287, 288, 289, 290, 294, 299, 304, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 336, 337, 341, 343, 348, 350, + 355, 356, 360, 361, 365, 367, 369, 372, 376, 378, + 383, 385, 387, 392, 397, 399, 404, 409, 411, 416, + 418, 423, 428, 433, 438, 443, 448, 453, 455, 460, + 465, 467, 472, 477, 482, 487, 489, 494, 499, 504, + 509, 510, 511, 515, 516, 520, 522, 524, 526, 528, + 530, 532, 534, 536, 538, 540, 545, 547, 552, 554, + 559, 564, 566, 568, 570, 572, 574, 576, 578, 580, + 582, 584, 586, 588, 590, 592, 594, 596, 598, 603, + 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 633, 638, 643, 644, + 647, 648, 652, 654, 656, 658, 660, 662, 667, 669, + 671, 673, 678, 683, 685, 688, 692, 695, 699, 701, + 706, 708, 713, 718, 723, 728, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 745, 750, 755, 760, 765, + 770, 775, 780, 785, 790, 795, 797, 802, 804, 809, + 814, 819, 824, 826, 831, 833, 838, 843 }; void @@ -4507,9 +4511,9 @@ namespace xsk { namespace gsc { namespace iw5 { #line 13 "parser.ypp" } } } // xsk::gsc::iw5 -#line 4511 "parser.cpp" +#line 4515 "parser.cpp" -#line 843 "parser.ypp" +#line 847 "parser.ypp" void xsk::gsc::iw5::parser::error(const xsk::gsc::location& loc, const std::string& msg) diff --git a/src/iw5/xsk/parser.hpp b/src/iw5/xsk/parser.hpp index f1f680a7..b5564aea 100644 --- a/src/iw5/xsk/parser.hpp +++ b/src/iw5/xsk/parser.hpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -47,10 +47,14 @@ // "%code requires" blocks. #line 28 "parser.ypp" +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "iw5.hpp" namespace xsk::gsc::iw5 { class lexer; } -#line 54 "parser.hpp" +#line 58 "parser.hpp" # include # include // std::abort @@ -126,12 +130,18 @@ namespace xsk::gsc::iw5 { class lexer; } # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -193,7 +203,7 @@ namespace xsk::gsc::iw5 { class lexer; } #line 13 "parser.ypp" namespace xsk { namespace gsc { namespace iw5 { -#line 197 "parser.hpp" +#line 207 "parser.hpp" @@ -202,27 +212,32 @@ namespace xsk { namespace gsc { namespace iw5 { class parser { public: -#ifndef IW5STYPE +#ifdef IW5STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define IW5STYPE in C++, use %define api.value.type" +# endif + typedef IW5STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { IW5_ASSERT (sizeof (T) <= size); @@ -231,13 +246,13 @@ namespace xsk { namespace gsc { namespace iw5 { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { IW5_ASSERT (!yytypeid_); } @@ -381,7 +396,7 @@ namespace xsk { namespace gsc { namespace iw5 { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -391,7 +406,7 @@ namespace xsk { namespace gsc { namespace iw5 { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -400,7 +415,7 @@ namespace xsk { namespace gsc { namespace iw5 { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -632,18 +647,19 @@ namespace xsk { namespace gsc { namespace iw5 { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef IW5STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef xsk::gsc::location location_type; @@ -789,7 +805,7 @@ namespace xsk { namespace gsc { namespace iw5 { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -1017,7 +1033,7 @@ namespace xsk { namespace gsc { namespace iw5 { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -2267,6 +2283,8 @@ namespace xsk { namespace gsc { namespace iw5 { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -2589,7 +2607,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -2604,22 +2622,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { - /// Default constructor. - by_kind (); - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that); -#endif - - /// Copy constructor. - by_kind (const by_kind& that); - /// The symbol kind as needed by the constructor. typedef token_kind_type kind_type; + /// Default constructor. + by_kind () YY_NOEXCEPT; + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that) YY_NOEXCEPT; +#endif + + /// Copy constructor. + by_kind (const by_kind& that) YY_NOEXCEPT; + /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -2649,30 +2669,34 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ IW5_ASSERT (tok == token::IW5EOF || (token::IW5error <= tok && tok <= token::MOD) || (token::SIZEOF <= tok && tok <= token::POSTDEC)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ IW5_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); +#endif } }; @@ -2721,7 +2745,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static const char *symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -4458,19 +4482,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const short yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; @@ -4497,14 +4521,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const unsigned char yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const unsigned char yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -4603,7 +4627,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -4682,7 +4706,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -4741,7 +4765,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -4760,7 +4784,7 @@ switch (yykind) inline parser::symbol_kind_type - parser::yytranslate_ (int t) + parser::yytranslate_ (int t) YY_NOEXCEPT { return static_cast (t); } @@ -5065,6 +5089,7 @@ switch (yykind) + template parser::symbol_kind_type parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -5072,6 +5097,7 @@ switch (yykind) return this->kind (); } + template bool parser::basic_symbol::empty () const YY_NOEXCEPT @@ -5378,13 +5404,13 @@ switch (yykind) // by_kind. inline - parser::by_kind::by_kind () + parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - parser::by_kind::by_kind (by_kind&& that) + parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -5392,15 +5418,17 @@ switch (yykind) #endif inline - parser::by_kind::by_kind (const by_kind& that) + parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - parser::by_kind::by_kind (token_kind_type t) + parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void parser::by_kind::clear () YY_NOEXCEPT @@ -5423,6 +5451,7 @@ switch (yykind) return kind_; } + inline parser::symbol_kind_type parser::by_kind::type_get () const YY_NOEXCEPT @@ -5430,9 +5459,10 @@ switch (yykind) return this->kind (); } + #line 13 "parser.ypp" } } } // xsk::gsc::iw5 -#line 5436 "parser.hpp" +#line 5466 "parser.hpp" diff --git a/src/iw5/xsk/resolver.cpp b/src/iw5/xsk/resolver.cpp index 4cb5b744..b69b4db5 100644 --- a/src/iw5/xsk/resolver.cpp +++ b/src/iw5/xsk/resolver.cpp @@ -6,6 +6,11 @@ #include "stdafx.hpp" #include "iw5.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4244) +#endif + namespace xsk::gsc::iw5 { @@ -61,7 +66,7 @@ auto resolver::function_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_func_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = function_map_rev.find(name); @@ -90,7 +95,7 @@ auto resolver::method_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_meth_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = method_map_rev.find(name); @@ -119,7 +124,7 @@ auto resolver::file_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = file_map_rev.find(name); @@ -148,7 +153,7 @@ auto resolver::token_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = token_map_rev.find(name); @@ -268,7 +273,7 @@ auto resolver::make_token(std::string_view str) -> std::string for (std::size_t i = 0; i < data.size(); i++) { - data[i] = std::tolower(str[i]); + data[i] = static_cast(std::tolower(static_cast(str[i]))); if (data[i] == '\\') data[i] = '/'; } @@ -8037,6 +8042,10 @@ __init__ _; } // namespace xsk::gsc::iw5 +#ifdef _MSC_VER +#pragma warning(pop) +#endif + /* unmaped files */ // "character/character_mp_ally_juggernaut" diff --git a/src/iw6/stdafx.hpp b/src/iw6/stdafx.hpp index a322313e..19f22f43 100644 --- a/src/iw6/stdafx.hpp +++ b/src/iw6/stdafx.hpp @@ -5,38 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4005) -#pragma warning(disable:4018) -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4389) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include -// Ext using namespace std::literals; - -#include "xsk/iw6.hpp" diff --git a/src/iw6/xsk/assembler.cpp b/src/iw6/xsk/assembler.cpp index b72aadff..dbd76e14 100644 --- a/src/iw6/xsk/assembler.cpp +++ b/src/iw6/xsk/assembler.cpp @@ -143,7 +143,7 @@ void assembler::assemble_function(const function::ptr& func) func->id = resolver::token_id(func->name); stack_->write(func->size); - stack_->write(func->id); + stack_->write(static_cast(func->id)); if (func->id == 0) { @@ -452,7 +452,7 @@ void assembler::assemble_end_switch(const instruction::ptr& inst) const auto count = std::stoul(inst->data[0]); - script_->write(count); + script_->write(static_cast(count)); std::uint32_t index = inst->index + 3; @@ -519,15 +519,15 @@ void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back if (expr) { - script_->write(addr - inst->index - 3); + script_->write(static_cast(addr - inst->index - 3)); } else if (back) { - script_->write((inst->index + 3) - addr); + script_->write(static_cast((inst->index + 3) - addr)); } else { - script_->write(addr - inst->index - 5); + script_->write(static_cast(addr - inst->index - 5)); } } @@ -546,11 +546,11 @@ void assembler::assemble_offset(std::int32_t offset) auto assembler::resolve_function(const std::string& name) -> std::int32_t { - for (const auto& func : functions_) + for (const auto& entry : functions_) { - if (func->name == name) + if (entry->name == name) { - return func->index; + return entry->index; } } @@ -559,11 +559,11 @@ auto assembler::resolve_function(const std::string& name) -> std::int32_t auto assembler::resolve_label(const std::string& name) -> std::int32_t { - for (const auto& func : labels_) + for (const auto& entry : labels_) { - if (func.second == name) + if (entry.second == name) { - return func.first; + return entry.first; } } diff --git a/src/iw6/xsk/compiler.cpp b/src/iw6/xsk/compiler.cpp index e10db85c..b9b2365c 100644 --- a/src/iw6/xsk/compiler.cpp +++ b/src/iw6/xsk/compiler.cpp @@ -840,7 +840,7 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: emit_opcode(opcode::OP_endswitch, data); - auto offset = 7 * stmt->stmt->list.size(); + auto offset = static_cast(7 * stmt->stmt->list.size()); function_->instructions.back()->size += offset; index_ += offset; @@ -2660,7 +2660,7 @@ auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const { if (blk->local_vars.at(i).init) { - return blk->local_vars_create_count - 1 - i; + return static_cast(blk->local_vars_create_count - 1 - i); } throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); diff --git a/src/iw6/xsk/decompiler.cpp b/src/iw6/xsk/decompiler.cpp index 3520149f..f506ed8e 100644 --- a/src/iw6/xsk/decompiler.cpp +++ b/src/iw6/xsk/decompiler.cpp @@ -1781,7 +1781,7 @@ void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) void decompiler::decompile_infinites(const ast::stmt_list::ptr& stmt) { - for (int i = stmt->list.size() - 1; i >= 0; i--) + for (auto i = stmt->list.size() - 1; i > 0; i--) { if (stmt->list.at(i) == ast::kind::asm_jump_back) { @@ -1944,7 +1944,7 @@ void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) } } -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_end = stmt->list.at(begin).as_cond->value; @@ -1972,7 +1972,7 @@ void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t beg stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.loc_end = stmt->list.at(end).loc().label(); @@ -2023,7 +2023,7 @@ void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.is_last = true; @@ -2083,7 +2083,7 @@ void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uin } } -void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); @@ -2113,7 +2113,7 @@ void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32 stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t start, std::uint32_t end) +void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::size_t start, std::size_t end) { auto& last = block->list.at(end - 1); @@ -2178,7 +2178,7 @@ void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t decompile_while(block, start, end); } -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2208,7 +2208,7 @@ void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2239,7 +2239,7 @@ void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2293,7 +2293,7 @@ void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t be stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2360,7 +2360,7 @@ void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t start) +void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) { block blk; blk.loc_continue = blocks_.back().loc_continue; @@ -2473,7 +2473,7 @@ void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); } -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool +auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool { for (auto i = begin; i < end; i++) { @@ -2492,7 +2492,7 @@ auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::u return false; } -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t +auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t { auto index = 0u; @@ -2510,7 +2510,7 @@ auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std: throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); } -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool +auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool { if (index == stmt->list.size() - 1) return true; @@ -3328,7 +3328,7 @@ void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) { - blk->local_vars_public_count = blk->local_vars.size() - std::stoi(expr->index); + blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); } } // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/decompiler.hpp b/src/iw6/xsk/decompiler.hpp index 8330fc3a..05ab0ee4 100644 --- a/src/iw6/xsk/decompiler.hpp +++ b/src/iw6/xsk/decompiler.hpp @@ -34,19 +34,19 @@ private: void decompile_switches(const ast::stmt_list::ptr& stmt); void decompile_ifelses(const ast::stmt_list::ptr& stmt); void decompile_aborts(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool; + void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); + auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; + auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; + auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; void process_stack(const ast::decl_thread::ptr& thread); void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); void process_stmt(const ast::stmt& stmt, const block::ptr& blk); diff --git a/src/iw6/xsk/disassembler.cpp b/src/iw6/xsk/disassembler.cpp index 6f5aa1a3..4656e9a1 100644 --- a/src/iw6/xsk/disassembler.cpp +++ b/src/iw6/xsk/disassembler.cpp @@ -51,7 +51,7 @@ void disassembler::disassemble(const std::string& file, std::vectorindex = static_cast(script_->pos()); func->size = stack_->read(); func->id = stack_->read(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id); + func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); dissasemble_function(func); diff --git a/src/iw6/xsk/lexer.cpp b/src/iw6/xsk/lexer.cpp index 16e37e1a..380b06b4 100644 --- a/src/iw6/xsk/lexer.cpp +++ b/src/iw6/xsk/lexer.cpp @@ -96,7 +96,7 @@ void reader::init(const char* data, size_t size) { state = reader::ok; buffer_pos = data; - bytes_remaining = size; + bytes_remaining = static_cast(size); last_byte = 0; current_byte = *data; } diff --git a/src/iw6/xsk/parser.cpp b/src/iw6/xsk/parser.cpp index a1e17e2b..59543e5e 100644 --- a/src/iw6/xsk/parser.cpp +++ b/src/iw6/xsk/parser.cpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -35,7 +35,7 @@ // private implementation details that can be changed or removed. // "%code top" blocks. -#line 34 "parser.ypp" +#line 38 "parser.ypp" #include "stdafx.hpp" #include "parser.hpp" @@ -166,9 +166,9 @@ namespace xsk { namespace gsc { namespace iw6 { parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -1451,7 +1451,7 @@ namespace xsk { namespace gsc { namespace iw6 { } void - parser::yypop_ (int n) + parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -1494,13 +1494,13 @@ namespace xsk { namespace gsc { namespace iw6 { } bool - parser::yy_pact_value_is_default_ (int yyvalue) + parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - parser::yy_table_value_is_error_ (int yyvalue) + parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -1531,8 +1531,8 @@ namespace xsk { namespace gsc { namespace iw6 { /// The return value of parse (). int yyresult; - /// Discard the LAC context in case there still is one left from a - /// previous invocation. + // Discard the LAC context in case there still is one left from a + // previous invocation. yy_lac_discard_ ("init"); #if YY_EXCEPTIONS @@ -1610,7 +1610,7 @@ namespace xsk { namespace gsc { namespace iw6 { if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) { if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; goto yydefault; } @@ -1621,7 +1621,7 @@ namespace xsk { namespace gsc { namespace iw6 { if (yy_table_value_is_error_ (yyn)) goto yyerrlab; if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -1964,1297 +1964,1297 @@ namespace xsk { namespace gsc { namespace iw6 { switch (yyn) { case 2: // root: program -#line 253 "parser.ypp" +#line 257 "parser.ypp" { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } #line 1970 "parser.cpp" break; case 3: // root: %empty -#line 254 "parser.ypp" +#line 258 "parser.ypp" { ast = std::make_unique(yylhs.location); } #line 1976 "parser.cpp" break; case 4: // program: program inline -#line 259 "parser.ypp" +#line 263 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } #line 1982 "parser.cpp" break; case 5: // program: program include -#line 261 "parser.ypp" +#line 265 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 1988 "parser.cpp" break; case 6: // program: program declaration -#line 263 "parser.ypp" +#line 267 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 1994 "parser.cpp" break; case 7: // program: inline -#line 265 "parser.ypp" +#line 269 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } #line 2000 "parser.cpp" break; case 8: // program: include -#line 267 "parser.ypp" +#line 271 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2006 "parser.cpp" break; case 9: // program: declaration -#line 269 "parser.ypp" +#line 273 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2012 "parser.cpp" break; case 10: // inline: "#inline" expr_path ";" -#line 273 "parser.ypp" +#line 277 "parser.ypp" { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } #line 2018 "parser.cpp" break; case 11: // include: "#include" expr_path ";" -#line 278 "parser.ypp" +#line 282 "parser.ypp" { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } #line 2024 "parser.cpp" break; case 12: // declaration: "/#" -#line 282 "parser.ypp" +#line 286 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } #line 2030 "parser.cpp" break; case 13: // declaration: "#/" -#line 283 "parser.ypp" +#line 287 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } #line 2036 "parser.cpp" break; case 14: // declaration: decl_usingtree -#line 284 "parser.ypp" +#line 288 "parser.ypp" { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } #line 2042 "parser.cpp" break; case 15: // declaration: decl_constant -#line 285 "parser.ypp" +#line 289 "parser.ypp" { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } #line 2048 "parser.cpp" break; case 16: // declaration: decl_thread -#line 286 "parser.ypp" +#line 290 "parser.ypp" { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } #line 2054 "parser.cpp" break; case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 291 "parser.ypp" +#line 295 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_usingtree::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_string::ptr > ())); } #line 2060 "parser.cpp" break; case 18: // decl_constant: expr_identifier "=" expr ";" -#line 296 "parser.ypp" +#line 300 "parser.ypp" { yylhs.value.as < ast::decl_constant::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 2066 "parser.cpp" break; case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 301 "parser.ypp" +#line 305 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2072 "parser.cpp" break; case 20: // stmt: stmt_block -#line 305 "parser.ypp" +#line 309 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } #line 2078 "parser.cpp" break; case 21: // stmt: stmt_call -#line 306 "parser.ypp" +#line 310 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } #line 2084 "parser.cpp" break; case 22: // stmt: stmt_assign -#line 307 "parser.ypp" +#line 311 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } #line 2090 "parser.cpp" break; case 23: // stmt: stmt_endon -#line 308 "parser.ypp" +#line 312 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } #line 2096 "parser.cpp" break; case 24: // stmt: stmt_notify -#line 309 "parser.ypp" +#line 313 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } #line 2102 "parser.cpp" break; case 25: // stmt: stmt_wait -#line 310 "parser.ypp" +#line 314 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } #line 2108 "parser.cpp" break; case 26: // stmt: stmt_waittill -#line 311 "parser.ypp" +#line 315 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } #line 2114 "parser.cpp" break; case 27: // stmt: stmt_waittillmatch -#line 312 "parser.ypp" +#line 316 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } #line 2120 "parser.cpp" break; case 28: // stmt: stmt_waittillframeend -#line 313 "parser.ypp" +#line 317 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } #line 2126 "parser.cpp" break; case 29: // stmt: stmt_if -#line 314 "parser.ypp" +#line 318 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } #line 2132 "parser.cpp" break; case 30: // stmt: stmt_ifelse -#line 315 "parser.ypp" +#line 319 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } #line 2138 "parser.cpp" break; case 31: // stmt: stmt_while -#line 316 "parser.ypp" +#line 320 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } #line 2144 "parser.cpp" break; case 32: // stmt: stmt_dowhile -#line 317 "parser.ypp" +#line 321 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } #line 2150 "parser.cpp" break; case 33: // stmt: stmt_for -#line 318 "parser.ypp" +#line 322 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } #line 2156 "parser.cpp" break; case 34: // stmt: stmt_foreach -#line 319 "parser.ypp" +#line 323 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } #line 2162 "parser.cpp" break; case 35: // stmt: stmt_switch -#line 320 "parser.ypp" +#line 324 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } #line 2168 "parser.cpp" break; case 36: // stmt: stmt_case -#line 321 "parser.ypp" +#line 325 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } #line 2174 "parser.cpp" break; case 37: // stmt: stmt_default -#line 322 "parser.ypp" +#line 326 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } #line 2180 "parser.cpp" break; case 38: // stmt: stmt_break -#line 323 "parser.ypp" +#line 327 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } #line 2186 "parser.cpp" break; case 39: // stmt: stmt_continue -#line 324 "parser.ypp" +#line 328 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } #line 2192 "parser.cpp" break; case 40: // stmt: stmt_return -#line 325 "parser.ypp" +#line 329 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } #line 2198 "parser.cpp" break; case 41: // stmt: stmt_breakpoint -#line 326 "parser.ypp" +#line 330 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } #line 2204 "parser.cpp" break; case 42: // stmt: stmt_prof_begin -#line 327 "parser.ypp" +#line 331 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } #line 2210 "parser.cpp" break; case 43: // stmt: stmt_prof_end -#line 328 "parser.ypp" +#line 332 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } #line 2216 "parser.cpp" break; case 44: // stmt_or_dev: stmt -#line 332 "parser.ypp" +#line 336 "parser.ypp" { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } #line 2222 "parser.cpp" break; case 45: // stmt_or_dev: stmt_dev -#line 333 "parser.ypp" +#line 337 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } #line 2228 "parser.cpp" break; case 46: // stmt_list: stmt_list stmt -#line 338 "parser.ypp" +#line 342 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2234 "parser.cpp" break; case 47: // stmt_list: stmt -#line 340 "parser.ypp" +#line 344 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2240 "parser.cpp" break; case 48: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 345 "parser.ypp" +#line 349 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2246 "parser.cpp" break; case 49: // stmt_or_dev_list: stmt_or_dev -#line 347 "parser.ypp" +#line 351 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2252 "parser.cpp" break; case 50: // stmt_dev: "/#" stmt_list "#/" -#line 351 "parser.ypp" +#line 355 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::stmt_list::ptr > ())); } #line 2258 "parser.cpp" break; case 51: // stmt_dev: "/#" "#/" -#line 352 "parser.ypp" +#line 356 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2264 "parser.cpp" break; case 52: // stmt_block: "{" stmt_or_dev_list "}" -#line 356 "parser.ypp" +#line 360 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } #line 2270 "parser.cpp" break; case 53: // stmt_block: "{" "}" -#line 357 "parser.ypp" +#line 361 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } #line 2276 "parser.cpp" break; case 54: // stmt_expr: expr_assign -#line 362 "parser.ypp" +#line 366 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2282 "parser.cpp" break; case 55: // stmt_expr: expr_increment -#line 364 "parser.ypp" +#line 368 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2288 "parser.cpp" break; case 56: // stmt_expr: expr_decrement -#line 366 "parser.ypp" +#line 370 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2294 "parser.cpp" break; case 57: // stmt_expr: %empty -#line 368 "parser.ypp" +#line 372 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2300 "parser.cpp" break; case 58: // stmt_call: expr_call ";" -#line 373 "parser.ypp" +#line 377 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_call::ptr > ()))); } #line 2306 "parser.cpp" break; case 59: // stmt_call: expr_method ";" -#line 375 "parser.ypp" +#line 379 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_method::ptr > ()))); } #line 2312 "parser.cpp" break; case 60: // stmt_assign: expr_assign ";" -#line 380 "parser.ypp" +#line 384 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2318 "parser.cpp" break; case 61: // stmt_assign: expr_increment ";" -#line 382 "parser.ypp" +#line 386 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2324 "parser.cpp" break; case 62: // stmt_assign: expr_decrement ";" -#line 384 "parser.ypp" +#line 388 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2330 "parser.cpp" break; case 63: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 389 "parser.ypp" +#line 393 "parser.ypp" { yylhs.value.as < ast::stmt_endon::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ())); } #line 2336 "parser.cpp" break; case 64: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 394 "parser.ypp" +#line 398 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2342 "parser.cpp" break; case 65: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 396 "parser.ypp" +#line 400 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2348 "parser.cpp" break; case 66: // stmt_wait: "wait" expr ";" -#line 401 "parser.ypp" +#line 405 "parser.ypp" { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2354 "parser.cpp" break; case 67: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 406 "parser.ypp" +#line 410 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2360 "parser.cpp" break; case 68: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 408 "parser.ypp" +#line 412 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2366 "parser.cpp" break; case 69: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 413 "parser.ypp" +#line 417 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2372 "parser.cpp" break; case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 415 "parser.ypp" +#line 419 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2378 "parser.cpp" break; case 71: // stmt_waittillframeend: "waittillframeend" ";" -#line 420 "parser.ypp" +#line 424 "parser.ypp" { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } #line 2384 "parser.cpp" break; case 72: // stmt_if: "if" "(" expr ")" stmt -#line 425 "parser.ypp" +#line 429 "parser.ypp" { yylhs.value.as < ast::stmt_if::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2390 "parser.cpp" break; case 73: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 430 "parser.ypp" +#line 434 "parser.ypp" { yylhs.value.as < ast::stmt_ifelse::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::stmt > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2396 "parser.cpp" break; case 74: // stmt_while: "while" "(" expr ")" stmt -#line 435 "parser.ypp" +#line 439 "parser.ypp" { yylhs.value.as < ast::stmt_while::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2402 "parser.cpp" break; case 75: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 440 "parser.ypp" +#line 444 "parser.ypp" { yylhs.value.as < ast::stmt_dowhile::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[5].value.as < ast::stmt > ())); } #line 2408 "parser.cpp" break; case 76: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 445 "parser.ypp" +#line 449 "parser.ypp" { yylhs.value.as < ast::stmt_for::ptr > () = std::make_unique(yylhs.location, ast::stmt(std::move(yystack_[6].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[4].value.as < ast::expr > ()), ast::stmt(std::move(yystack_[2].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2414 "parser.cpp" break; case 77: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 450 "parser.ypp" +#line 454 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2420 "parser.cpp" break; case 78: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 452 "parser.ypp" +#line 456 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[6].value.as < ast::expr_identifier::ptr > ())), ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2426 "parser.cpp" break; case 79: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 457 "parser.ypp" +#line 461 "parser.ypp" { yylhs.value.as < ast::stmt_switch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2432 "parser.cpp" break; case 80: // stmt_case: "case" expr_integer ":" -#line 462 "parser.ypp" +#line 466 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_integer::ptr > ())), std::make_unique(yylhs.location)); } #line 2438 "parser.cpp" break; case 81: // stmt_case: "case" expr_string ":" -#line 464 "parser.ypp" +#line 468 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_string::ptr > ())), std::make_unique(yylhs.location)); } #line 2444 "parser.cpp" break; case 82: // stmt_default: "default" ":" -#line 469 "parser.ypp" +#line 473 "parser.ypp" { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2450 "parser.cpp" break; case 83: // stmt_break: "break" ";" -#line 474 "parser.ypp" +#line 478 "parser.ypp" { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } #line 2456 "parser.cpp" break; case 84: // stmt_continue: "continue" ";" -#line 479 "parser.ypp" +#line 483 "parser.ypp" { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } #line 2462 "parser.cpp" break; case 85: // stmt_return: "return" expr ";" -#line 484 "parser.ypp" +#line 488 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2468 "parser.cpp" break; case 86: // stmt_return: "return" ";" -#line 486 "parser.ypp" +#line 490 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2474 "parser.cpp" break; case 87: // stmt_breakpoint: "breakpoint" ";" -#line 491 "parser.ypp" +#line 495 "parser.ypp" { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } #line 2480 "parser.cpp" break; case 88: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 496 "parser.ypp" +#line 500 "parser.ypp" { yylhs.value.as < ast::stmt_prof_begin::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2486 "parser.cpp" break; case 89: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 501 "parser.ypp" +#line 505 "parser.ypp" { yylhs.value.as < ast::stmt_prof_end::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2492 "parser.cpp" break; case 90: // expr: expr_ternary -#line 505 "parser.ypp" +#line 509 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2498 "parser.cpp" break; case 91: // expr: expr_binary -#line 506 "parser.ypp" +#line 510 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2504 "parser.cpp" break; case 92: // expr: expr_primitive -#line 507 "parser.ypp" +#line 511 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2510 "parser.cpp" break; case 93: // expr_or_empty: expr -#line 511 "parser.ypp" +#line 515 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2516 "parser.cpp" break; case 94: // expr_or_empty: %empty -#line 512 "parser.ypp" +#line 516 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } #line 2522 "parser.cpp" break; case 95: // expr_assign: expr_object "=" expr -#line 517 "parser.ypp" +#line 521 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2528 "parser.cpp" break; case 96: // expr_assign: expr_object "|=" expr -#line 519 "parser.ypp" +#line 523 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2534 "parser.cpp" break; case 97: // expr_assign: expr_object "&=" expr -#line 521 "parser.ypp" +#line 525 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2540 "parser.cpp" break; case 98: // expr_assign: expr_object "^=" expr -#line 523 "parser.ypp" +#line 527 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2546 "parser.cpp" break; case 99: // expr_assign: expr_object "<<=" expr -#line 525 "parser.ypp" +#line 529 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()),std::move( yystack_[0].value.as < ast::expr > ())); } #line 2552 "parser.cpp" break; case 100: // expr_assign: expr_object ">>=" expr -#line 527 "parser.ypp" +#line 531 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2558 "parser.cpp" break; case 101: // expr_assign: expr_object "+=" expr -#line 529 "parser.ypp" +#line 533 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2564 "parser.cpp" break; case 102: // expr_assign: expr_object "-=" expr -#line 531 "parser.ypp" +#line 535 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2570 "parser.cpp" break; case 103: // expr_assign: expr_object "*=" expr -#line 533 "parser.ypp" +#line 537 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2576 "parser.cpp" break; case 104: // expr_assign: expr_object "/=" expr -#line 535 "parser.ypp" +#line 539 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2582 "parser.cpp" break; case 105: // expr_assign: expr_object "%=" expr -#line 537 "parser.ypp" +#line 541 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2588 "parser.cpp" break; case 106: // expr_increment: "++" expr_object -#line 542 "parser.ypp" +#line 546 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2594 "parser.cpp" break; case 107: // expr_increment: expr_object "++" -#line 544 "parser.ypp" +#line 548 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2600 "parser.cpp" break; case 108: // expr_decrement: "--" expr_object -#line 549 "parser.ypp" +#line 553 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2606 "parser.cpp" break; case 109: // expr_decrement: expr_object "--" -#line 551 "parser.ypp" +#line 555 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2612 "parser.cpp" break; case 110: // expr_ternary: expr "?" expr ":" expr -#line 556 "parser.ypp" +#line 560 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2618 "parser.cpp" break; case 111: // expr_binary: expr "||" expr -#line 561 "parser.ypp" +#line 565 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2624 "parser.cpp" break; case 112: // expr_binary: expr "&&" expr -#line 563 "parser.ypp" +#line 567 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2630 "parser.cpp" break; case 113: // expr_binary: expr "==" expr -#line 565 "parser.ypp" +#line 569 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2636 "parser.cpp" break; case 114: // expr_binary: expr "!=" expr -#line 567 "parser.ypp" +#line 571 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2642 "parser.cpp" break; case 115: // expr_binary: expr "<=" expr -#line 569 "parser.ypp" +#line 573 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2648 "parser.cpp" break; case 116: // expr_binary: expr ">=" expr -#line 571 "parser.ypp" +#line 575 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2654 "parser.cpp" break; case 117: // expr_binary: expr "<" expr -#line 573 "parser.ypp" +#line 577 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2660 "parser.cpp" break; case 118: // expr_binary: expr ">" expr -#line 575 "parser.ypp" +#line 579 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2666 "parser.cpp" break; case 119: // expr_binary: expr "|" expr -#line 577 "parser.ypp" +#line 581 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2672 "parser.cpp" break; case 120: // expr_binary: expr "&" expr -#line 579 "parser.ypp" +#line 583 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2678 "parser.cpp" break; case 121: // expr_binary: expr "^" expr -#line 581 "parser.ypp" +#line 585 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2684 "parser.cpp" break; case 122: // expr_binary: expr "<<" expr -#line 583 "parser.ypp" +#line 587 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2690 "parser.cpp" break; case 123: // expr_binary: expr ">>" expr -#line 585 "parser.ypp" +#line 589 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2696 "parser.cpp" break; case 124: // expr_binary: expr "+" expr -#line 587 "parser.ypp" +#line 591 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2702 "parser.cpp" break; case 125: // expr_binary: expr "-" expr -#line 589 "parser.ypp" +#line 593 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2708 "parser.cpp" break; case 126: // expr_binary: expr "*" expr -#line 591 "parser.ypp" +#line 595 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2714 "parser.cpp" break; case 127: // expr_binary: expr "/" expr -#line 593 "parser.ypp" +#line 597 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2720 "parser.cpp" break; case 128: // expr_binary: expr "%" expr -#line 595 "parser.ypp" +#line 599 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2726 "parser.cpp" break; case 129: // expr_primitive: expr_complement -#line 599 "parser.ypp" +#line 603 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } #line 2732 "parser.cpp" break; case 130: // expr_primitive: expr_not -#line 600 "parser.ypp" +#line 604 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } #line 2738 "parser.cpp" break; case 131: // expr_primitive: expr_call -#line 601 "parser.ypp" +#line 605 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 2744 "parser.cpp" break; case 132: // expr_primitive: expr_method -#line 602 "parser.ypp" +#line 606 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 2750 "parser.cpp" break; case 133: // expr_primitive: expr_add_array -#line 603 "parser.ypp" +#line 607 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } #line 2756 "parser.cpp" break; case 134: // expr_primitive: expr_reference -#line 604 "parser.ypp" +#line 608 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } #line 2762 "parser.cpp" break; case 135: // expr_primitive: expr_array -#line 605 "parser.ypp" +#line 609 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 2768 "parser.cpp" break; case 136: // expr_primitive: expr_field -#line 606 "parser.ypp" +#line 610 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 2774 "parser.cpp" break; case 137: // expr_primitive: expr_size -#line 607 "parser.ypp" +#line 611 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } #line 2780 "parser.cpp" break; case 138: // expr_primitive: expr_paren -#line 608 "parser.ypp" +#line 612 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } #line 2786 "parser.cpp" break; case 139: // expr_primitive: expr_thisthread -#line 609 "parser.ypp" +#line 613 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } #line 2792 "parser.cpp" break; case 140: // expr_primitive: expr_empty_array -#line 610 "parser.ypp" +#line 614 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } #line 2798 "parser.cpp" break; case 141: // expr_primitive: expr_undefined -#line 611 "parser.ypp" +#line 615 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } #line 2804 "parser.cpp" break; case 142: // expr_primitive: expr_game -#line 612 "parser.ypp" +#line 616 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 2810 "parser.cpp" break; case 143: // expr_primitive: expr_self -#line 613 "parser.ypp" +#line 617 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 2816 "parser.cpp" break; case 144: // expr_primitive: expr_anim -#line 614 "parser.ypp" +#line 618 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 2822 "parser.cpp" break; case 145: // expr_primitive: expr_level -#line 615 "parser.ypp" +#line 619 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 2828 "parser.cpp" break; case 146: // expr_primitive: expr_animation -#line 616 "parser.ypp" +#line 620 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } #line 2834 "parser.cpp" break; case 147: // expr_primitive: expr_animtree -#line 617 "parser.ypp" +#line 621 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } #line 2840 "parser.cpp" break; case 148: // expr_primitive: expr_identifier -#line 618 "parser.ypp" +#line 622 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 2846 "parser.cpp" break; case 149: // expr_primitive: expr_istring -#line 619 "parser.ypp" +#line 623 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } #line 2852 "parser.cpp" break; case 150: // expr_primitive: expr_string -#line 620 "parser.ypp" +#line 624 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } #line 2858 "parser.cpp" break; case 151: // expr_primitive: expr_vector -#line 621 "parser.ypp" +#line 625 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } #line 2864 "parser.cpp" break; case 152: // expr_primitive: expr_float -#line 622 "parser.ypp" +#line 626 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } #line 2870 "parser.cpp" break; case 153: // expr_primitive: expr_integer -#line 623 "parser.ypp" +#line 627 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } #line 2876 "parser.cpp" break; case 154: // expr_primitive: expr_false -#line 624 "parser.ypp" +#line 628 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } #line 2882 "parser.cpp" break; case 155: // expr_primitive: expr_true -#line 625 "parser.ypp" +#line 629 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } #line 2888 "parser.cpp" break; case 156: // expr_complement: "~" expr -#line 630 "parser.ypp" +#line 634 "parser.ypp" { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2894 "parser.cpp" break; case 157: // expr_not: "!" expr -#line 635 "parser.ypp" +#line 639 "parser.ypp" { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2900 "parser.cpp" break; case 158: // expr_call: expr_function -#line 639 "parser.ypp" +#line 643 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2906 "parser.cpp" break; case 159: // expr_call: expr_pointer -#line 640 "parser.ypp" +#line 644 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2912 "parser.cpp" break; case 160: // expr_method: expr_object expr_function -#line 643 "parser.ypp" +#line 647 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 2918 "parser.cpp" break; case 161: // expr_method: expr_object expr_pointer -#line 644 "parser.ypp" +#line 648 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 2924 "parser.cpp" break; case 162: // expr_function: expr_identifier "(" expr_arguments ")" -#line 649 "parser.ypp" +#line 653 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2930 "parser.cpp" break; case 163: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 651 "parser.ypp" +#line 655 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2936 "parser.cpp" break; case 164: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 653 "parser.ypp" +#line 657 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2942 "parser.cpp" break; case 165: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 655 "parser.ypp" +#line 659 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2948 "parser.cpp" break; case 166: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 657 "parser.ypp" +#line 661 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2954 "parser.cpp" break; case 167: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 659 "parser.ypp" +#line 663 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2960 "parser.cpp" break; case 168: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 664 "parser.ypp" +#line 668 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2966 "parser.cpp" break; case 169: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 666 "parser.ypp" +#line 670 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2972 "parser.cpp" break; case 170: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 668 "parser.ypp" +#line 672 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2978 "parser.cpp" break; case 171: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 670 "parser.ypp" +#line 674 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::builtin); } #line 2984 "parser.cpp" break; case 172: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 675 "parser.ypp" +#line 679 "parser.ypp" { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } #line 2990 "parser.cpp" break; case 173: // expr_parameters: expr_parameters "," expr_identifier -#line 680 "parser.ypp" +#line 684 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 2996 "parser.cpp" break; case 174: // expr_parameters: expr_identifier -#line 682 "parser.ypp" +#line 686 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3002 "parser.cpp" break; case 175: // expr_parameters: %empty -#line 684 "parser.ypp" +#line 688 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } #line 3008 "parser.cpp" break; case 176: // expr_arguments: expr_arguments_no_empty -#line 689 "parser.ypp" +#line 693 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } #line 3014 "parser.cpp" break; case 177: // expr_arguments: %empty -#line 691 "parser.ypp" +#line 695 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } #line 3020 "parser.cpp" break; case 178: // expr_arguments_no_empty: expr_arguments "," expr -#line 696 "parser.ypp" +#line 700 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ()); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3026 "parser.cpp" break; case 179: // expr_arguments_no_empty: expr -#line 698 "parser.ypp" +#line 702 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3032 "parser.cpp" break; case 180: // expr_reference: "::" expr_identifier -#line 703 "parser.ypp" +#line 707 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3038 "parser.cpp" break; case 181: // expr_reference: expr_path "::" expr_identifier -#line 705 "parser.ypp" +#line 709 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_path::ptr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3044 "parser.cpp" break; case 182: // expr_array: expr_object "[" expr "]" -#line 710 "parser.ypp" +#line 714 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3050 "parser.cpp" break; case 183: // expr_field: expr_object "." expr_identifier_nosize -#line 715 "parser.ypp" +#line 719 "parser.ypp" { yylhs.value.as < ast::expr_field::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3056 "parser.cpp" break; case 184: // expr_size: expr_object "." "size" -#line 720 "parser.ypp" +#line 724 "parser.ypp" { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } #line 3062 "parser.cpp" break; case 185: // expr_paren: "(" expr ")" -#line 725 "parser.ypp" +#line 729 "parser.ypp" { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3068 "parser.cpp" break; case 186: // expr_object: expr_call -#line 729 "parser.ypp" +#line 733 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 3074 "parser.cpp" break; case 187: // expr_object: expr_method -#line 730 "parser.ypp" +#line 734 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 3080 "parser.cpp" break; case 188: // expr_object: expr_array -#line 731 "parser.ypp" +#line 735 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 3086 "parser.cpp" break; case 189: // expr_object: expr_field -#line 732 "parser.ypp" +#line 736 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 3092 "parser.cpp" break; case 190: // expr_object: expr_game -#line 733 "parser.ypp" +#line 737 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 3098 "parser.cpp" break; case 191: // expr_object: expr_self -#line 734 "parser.ypp" +#line 738 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 3104 "parser.cpp" break; case 192: // expr_object: expr_anim -#line 735 "parser.ypp" +#line 739 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 3110 "parser.cpp" break; case 193: // expr_object: expr_level -#line 736 "parser.ypp" +#line 740 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 3116 "parser.cpp" break; case 194: // expr_object: expr_identifier -#line 737 "parser.ypp" +#line 741 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 3122 "parser.cpp" break; case 195: // expr_thisthread: "thisthread" -#line 742 "parser.ypp" +#line 746 "parser.ypp" { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } #line 3128 "parser.cpp" break; case 196: // expr_empty_array: "[" "]" -#line 747 "parser.ypp" +#line 751 "parser.ypp" { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } #line 3134 "parser.cpp" break; case 197: // expr_undefined: "undefined" -#line 752 "parser.ypp" +#line 756 "parser.ypp" { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } #line 3140 "parser.cpp" break; case 198: // expr_game: "game" -#line 757 "parser.ypp" +#line 761 "parser.ypp" { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } #line 3146 "parser.cpp" break; case 199: // expr_self: "self" -#line 762 "parser.ypp" +#line 766 "parser.ypp" { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } #line 3152 "parser.cpp" break; case 200: // expr_anim: "anim" -#line 767 "parser.ypp" +#line 771 "parser.ypp" { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } #line 3158 "parser.cpp" break; case 201: // expr_level: "level" -#line 772 "parser.ypp" +#line 776 "parser.ypp" { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } #line 3164 "parser.cpp" break; case 202: // expr_animation: "%" "identifier" -#line 777 "parser.ypp" +#line 781 "parser.ypp" { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3170 "parser.cpp" break; case 203: // expr_animtree: "#animtree" -#line 782 "parser.ypp" +#line 786 "parser.ypp" { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } #line 3176 "parser.cpp" break; case 204: // expr_identifier_nosize: "identifier" -#line 787 "parser.ypp" +#line 791 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3182 "parser.cpp" break; case 205: // expr_identifier: "identifier" -#line 792 "parser.ypp" +#line 796 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3188 "parser.cpp" break; case 206: // expr_identifier: "size" -#line 794 "parser.ypp" +#line 798 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } #line 3194 "parser.cpp" break; case 207: // expr_path: "identifier" -#line 799 "parser.ypp" +#line 803 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3200 "parser.cpp" break; case 208: // expr_path: "path" -#line 801 "parser.ypp" +#line 805 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3206 "parser.cpp" break; case 209: // expr_istring: "localized string" -#line 806 "parser.ypp" +#line 810 "parser.ypp" { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3212 "parser.cpp" break; case 210: // expr_string: "string literal" -#line 811 "parser.ypp" +#line 815 "parser.ypp" { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3218 "parser.cpp" break; case 211: // expr_vector: "(" expr "," expr "," expr ")" -#line 816 "parser.ypp" +#line 820 "parser.ypp" { yylhs.value.as < ast::expr_vector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3224 "parser.cpp" break; case 212: // expr_float: "-" "float" -#line 821 "parser.ypp" +#line 825 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3230 "parser.cpp" break; case 213: // expr_float: "float" -#line 823 "parser.ypp" +#line 827 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3236 "parser.cpp" break; case 214: // expr_integer: "-" "integer" -#line 828 "parser.ypp" +#line 832 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3242 "parser.cpp" break; case 215: // expr_integer: "integer" -#line 830 "parser.ypp" +#line 834 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3248 "parser.cpp" break; case 216: // expr_false: "false" -#line 835 "parser.ypp" +#line 839 "parser.ypp" { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } #line 3254 "parser.cpp" break; case 217: // expr_true: "true" -#line 840 "parser.ypp" +#line 844 "parser.ypp" { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } #line 3260 "parser.cpp" break; @@ -3523,6 +3523,8 @@ namespace xsk { namespace gsc { namespace iw6 { } + + bool parser::yy_lac_check_ (symbol_kind_type yytoken) const { @@ -3627,7 +3629,9 @@ namespace xsk { namespace gsc { namespace iw6 { follows. If no initial context is currently established for the current lookahead, then check if that lookahead can eventually be shifted if syntactic actions continue from the current context. */ - if (!yy_lac_established_) + if (yy_lac_established_) + return true; + else { #if IW6DEBUG YYCDEBUG << "LAC: initial context established for " @@ -3636,12 +3640,11 @@ namespace xsk { namespace gsc { namespace iw6 { yy_lac_established_ = true; return yy_lac_check_ (yytoken); } - return true; } // Discard any previous initial lookahead context. void - parser::yy_lac_discard_ (const char* evt) + parser::yy_lac_discard_ (const char* event) { /* Discard any previous initial lookahead context because of Event, which may be a lookahead change or an invalidation of the currently @@ -3657,11 +3660,12 @@ namespace xsk { namespace gsc { namespace iw6 { if (yy_lac_established_) { YYCDEBUG << "LAC: initial context discarded due to " - << evt << '\n'; + << event << '\n'; yy_lac_established_ = false; } } + int parser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -4453,28 +4457,28 @@ namespace xsk { namespace gsc { namespace iw6 { const short parser::yyrline_[] = { - 0, 253, 253, 254, 258, 260, 262, 264, 266, 268, - 273, 277, 282, 283, 284, 285, 286, 290, 295, 300, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 332, 333, 337, 339, 344, 346, - 351, 352, 356, 357, 361, 363, 365, 368, 372, 374, - 379, 381, 383, 388, 393, 395, 400, 405, 407, 412, - 414, 419, 424, 429, 434, 439, 444, 449, 451, 456, - 461, 463, 468, 473, 478, 483, 485, 490, 495, 500, - 505, 506, 507, 511, 512, 516, 518, 520, 522, 524, - 526, 528, 530, 532, 534, 536, 541, 543, 548, 550, - 555, 560, 562, 564, 566, 568, 570, 572, 574, 576, - 578, 580, 582, 584, 586, 588, 590, 592, 594, 599, - 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, - 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, - 620, 621, 622, 623, 624, 625, 629, 634, 639, 640, - 643, 644, 648, 650, 652, 654, 656, 658, 663, 665, - 667, 669, 674, 679, 681, 684, 688, 691, 695, 697, - 702, 704, 709, 714, 719, 724, 729, 730, 731, 732, - 733, 734, 735, 736, 737, 741, 746, 751, 756, 761, - 766, 771, 776, 781, 786, 791, 793, 798, 800, 805, - 810, 815, 820, 822, 827, 829, 834, 839 + 0, 257, 257, 258, 262, 264, 266, 268, 270, 272, + 277, 281, 286, 287, 288, 289, 290, 294, 299, 304, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 336, 337, 341, 343, 348, 350, + 355, 356, 360, 361, 365, 367, 369, 372, 376, 378, + 383, 385, 387, 392, 397, 399, 404, 409, 411, 416, + 418, 423, 428, 433, 438, 443, 448, 453, 455, 460, + 465, 467, 472, 477, 482, 487, 489, 494, 499, 504, + 509, 510, 511, 515, 516, 520, 522, 524, 526, 528, + 530, 532, 534, 536, 538, 540, 545, 547, 552, 554, + 559, 564, 566, 568, 570, 572, 574, 576, 578, 580, + 582, 584, 586, 588, 590, 592, 594, 596, 598, 603, + 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 633, 638, 643, 644, + 647, 648, 652, 654, 656, 658, 660, 662, 667, 669, + 671, 673, 678, 683, 685, 688, 692, 695, 699, 701, + 706, 708, 713, 718, 723, 728, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 745, 750, 755, 760, 765, + 770, 775, 780, 785, 790, 795, 797, 802, 804, 809, + 814, 819, 824, 826, 831, 833, 838, 843 }; void @@ -4507,9 +4511,9 @@ namespace xsk { namespace gsc { namespace iw6 { #line 13 "parser.ypp" } } } // xsk::gsc::iw6 -#line 4511 "parser.cpp" +#line 4515 "parser.cpp" -#line 843 "parser.ypp" +#line 847 "parser.ypp" void xsk::gsc::iw6::parser::error(const xsk::gsc::location& loc, const std::string& msg) diff --git a/src/iw6/xsk/parser.hpp b/src/iw6/xsk/parser.hpp index 0ffb8958..641054ba 100644 --- a/src/iw6/xsk/parser.hpp +++ b/src/iw6/xsk/parser.hpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -47,10 +47,14 @@ // "%code requires" blocks. #line 28 "parser.ypp" +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "iw6.hpp" namespace xsk::gsc::iw6 { class lexer; } -#line 54 "parser.hpp" +#line 58 "parser.hpp" # include # include // std::abort @@ -126,12 +130,18 @@ namespace xsk::gsc::iw6 { class lexer; } # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -193,7 +203,7 @@ namespace xsk::gsc::iw6 { class lexer; } #line 13 "parser.ypp" namespace xsk { namespace gsc { namespace iw6 { -#line 197 "parser.hpp" +#line 207 "parser.hpp" @@ -202,27 +212,32 @@ namespace xsk { namespace gsc { namespace iw6 { class parser { public: -#ifndef IW6STYPE +#ifdef IW6STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define IW6STYPE in C++, use %define api.value.type" +# endif + typedef IW6STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { IW6_ASSERT (sizeof (T) <= size); @@ -231,13 +246,13 @@ namespace xsk { namespace gsc { namespace iw6 { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { IW6_ASSERT (!yytypeid_); } @@ -381,7 +396,7 @@ namespace xsk { namespace gsc { namespace iw6 { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -391,7 +406,7 @@ namespace xsk { namespace gsc { namespace iw6 { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -400,7 +415,7 @@ namespace xsk { namespace gsc { namespace iw6 { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -632,18 +647,19 @@ namespace xsk { namespace gsc { namespace iw6 { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef IW6STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef xsk::gsc::location location_type; @@ -789,7 +805,7 @@ namespace xsk { namespace gsc { namespace iw6 { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -1017,7 +1033,7 @@ namespace xsk { namespace gsc { namespace iw6 { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -2267,6 +2283,8 @@ namespace xsk { namespace gsc { namespace iw6 { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -2589,7 +2607,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -2604,22 +2622,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { - /// Default constructor. - by_kind (); - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that); -#endif - - /// Copy constructor. - by_kind (const by_kind& that); - /// The symbol kind as needed by the constructor. typedef token_kind_type kind_type; + /// Default constructor. + by_kind () YY_NOEXCEPT; + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that) YY_NOEXCEPT; +#endif + + /// Copy constructor. + by_kind (const by_kind& that) YY_NOEXCEPT; + /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -2649,30 +2669,34 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ IW6_ASSERT (tok == token::IW6EOF || (token::IW6error <= tok && tok <= token::MOD) || (token::SIZEOF <= tok && tok <= token::POSTDEC)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ IW6_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); +#endif } }; @@ -2721,7 +2745,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static const char *symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -4458,19 +4482,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const short yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; @@ -4497,14 +4521,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const unsigned char yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const unsigned char yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -4603,7 +4627,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -4682,7 +4706,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -4741,7 +4765,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -4760,7 +4784,7 @@ switch (yykind) inline parser::symbol_kind_type - parser::yytranslate_ (int t) + parser::yytranslate_ (int t) YY_NOEXCEPT { return static_cast (t); } @@ -5065,6 +5089,7 @@ switch (yykind) + template parser::symbol_kind_type parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -5072,6 +5097,7 @@ switch (yykind) return this->kind (); } + template bool parser::basic_symbol::empty () const YY_NOEXCEPT @@ -5378,13 +5404,13 @@ switch (yykind) // by_kind. inline - parser::by_kind::by_kind () + parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - parser::by_kind::by_kind (by_kind&& that) + parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -5392,15 +5418,17 @@ switch (yykind) #endif inline - parser::by_kind::by_kind (const by_kind& that) + parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - parser::by_kind::by_kind (token_kind_type t) + parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void parser::by_kind::clear () YY_NOEXCEPT @@ -5423,6 +5451,7 @@ switch (yykind) return kind_; } + inline parser::symbol_kind_type parser::by_kind::type_get () const YY_NOEXCEPT @@ -5430,9 +5459,10 @@ switch (yykind) return this->kind (); } + #line 13 "parser.ypp" } } } // xsk::gsc::iw6 -#line 5436 "parser.hpp" +#line 5466 "parser.hpp" diff --git a/src/iw6/xsk/resolver.cpp b/src/iw6/xsk/resolver.cpp index eb5e187a..5965822e 100644 --- a/src/iw6/xsk/resolver.cpp +++ b/src/iw6/xsk/resolver.cpp @@ -6,6 +6,11 @@ #include "stdafx.hpp" #include "iw6.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4244) +#endif + namespace xsk::gsc::iw6 { @@ -61,7 +66,7 @@ auto resolver::function_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_func_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = function_map_rev.find(name); @@ -90,7 +95,7 @@ auto resolver::method_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_meth_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = method_map_rev.find(name); @@ -119,7 +124,7 @@ auto resolver::file_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = file_map_rev.find(name); @@ -148,7 +153,7 @@ auto resolver::token_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = token_map_rev.find(name); @@ -212,7 +217,7 @@ auto resolver::make_token(std::string_view str) -> std::string for (std::size_t i = 0; i < data.size(); i++) { - data[i] = std::tolower(str[i]); + data[i] = static_cast(std::tolower(static_cast(str[i]))); if (data[i] == '\\') data[i] = '/'; } @@ -16844,3 +16849,7 @@ struct __init__ __init__ _; } // namespace xsk::gsc::iw6 + +#ifdef _MSC_VER +#pragma warning(pop) +#endif diff --git a/src/iw7/stdafx.hpp b/src/iw7/stdafx.hpp index 33293f2f..337ac3c1 100644 --- a/src/iw7/stdafx.hpp +++ b/src/iw7/stdafx.hpp @@ -5,38 +5,24 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4005) -#pragma warning(disable:4018) -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4389) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include -// Ext using namespace std::literals; #include "xsk/iw7.hpp" diff --git a/src/iw7/xsk/assembler.cpp b/src/iw7/xsk/assembler.cpp index 800a58e6..bdf28892 100644 --- a/src/iw7/xsk/assembler.cpp +++ b/src/iw7/xsk/assembler.cpp @@ -452,7 +452,7 @@ void assembler::assemble_end_switch(const instruction::ptr& inst) const auto count = std::stoul(inst->data[0]); - script_->write(count); + script_->write(static_cast(count)); std::uint32_t index = inst->index + 3; @@ -519,15 +519,15 @@ void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back if (expr) { - script_->write(addr - inst->index - 3); + script_->write(static_cast(addr - inst->index - 3)); } else if (back) { - script_->write((inst->index + 3) - addr); + script_->write(static_cast((inst->index + 3) - addr)); } else { - script_->write(addr - inst->index - 5); + script_->write(static_cast(addr - inst->index - 5)); } } @@ -546,11 +546,11 @@ void assembler::assemble_offset(std::int32_t offset) auto assembler::resolve_function(const std::string& name) -> std::int32_t { - for (const auto& func : functions_) + for (const auto& entry : functions_) { - if (func->name == name) + if (entry->name == name) { - return func->index; + return entry->index; } } @@ -559,11 +559,11 @@ auto assembler::resolve_function(const std::string& name) -> std::int32_t auto assembler::resolve_label(const std::string& name) -> std::int32_t { - for (const auto& func : labels_) + for (const auto& entry : labels_) { - if (func.second == name) + if (entry.second == name) { - return func.first; + return entry.first; } } diff --git a/src/iw7/xsk/compiler.cpp b/src/iw7/xsk/compiler.cpp index 1e895ef0..54b68cc4 100644 --- a/src/iw7/xsk/compiler.cpp +++ b/src/iw7/xsk/compiler.cpp @@ -840,7 +840,7 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: emit_opcode(opcode::OP_endswitch, data); - auto offset = 7 * stmt->stmt->list.size(); + auto offset = static_cast(7 * stmt->stmt->list.size()); function_->instructions.back()->size += offset; index_ += offset; @@ -2660,7 +2660,7 @@ auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const { if (blk->local_vars.at(i).init) { - return blk->local_vars_create_count - 1 - i; + return static_cast(blk->local_vars_create_count - 1 - i); } throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); diff --git a/src/iw7/xsk/decompiler.cpp b/src/iw7/xsk/decompiler.cpp index 845c855d..8a6ba22d 100644 --- a/src/iw7/xsk/decompiler.cpp +++ b/src/iw7/xsk/decompiler.cpp @@ -1781,7 +1781,7 @@ void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) void decompiler::decompile_infinites(const ast::stmt_list::ptr& stmt) { - for (int i = stmt->list.size() - 1; i >= 0; i--) + for (auto i = stmt->list.size() - 1; i > 0; i--) { if (stmt->list.at(i) == ast::kind::asm_jump_back) { @@ -1944,7 +1944,7 @@ void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) } } -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_end = stmt->list.at(begin).as_cond->value; @@ -1972,7 +1972,7 @@ void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t beg stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.loc_end = stmt->list.at(end).loc().label(); @@ -2023,7 +2023,7 @@ void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.is_last = true; @@ -2083,7 +2083,7 @@ void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uin } } -void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); @@ -2113,7 +2113,7 @@ void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32 stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t start, std::uint32_t end) +void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::size_t start, std::size_t end) { auto& last = block->list.at(end - 1); @@ -2178,7 +2178,7 @@ void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t decompile_while(block, start, end); } -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2208,7 +2208,7 @@ void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2239,7 +2239,7 @@ void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2293,7 +2293,7 @@ void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t be stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2360,7 +2360,7 @@ void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t start) +void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) { block blk; blk.loc_continue = blocks_.back().loc_continue; @@ -2473,7 +2473,7 @@ void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); } -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool +auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool { for (auto i = begin; i < end; i++) { @@ -2492,7 +2492,7 @@ auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::u return false; } -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t +auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t { auto index = 0u; @@ -2510,7 +2510,7 @@ auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std: throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); } -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool +auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool { if (index == stmt->list.size() - 1) return true; @@ -3328,7 +3328,7 @@ void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) { - blk->local_vars_public_count = blk->local_vars.size() - std::stoi(expr->index); + blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); } } // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/decompiler.hpp b/src/iw7/xsk/decompiler.hpp index ad96ace2..477ef884 100644 --- a/src/iw7/xsk/decompiler.hpp +++ b/src/iw7/xsk/decompiler.hpp @@ -34,19 +34,19 @@ private: void decompile_switches(const ast::stmt_list::ptr& stmt); void decompile_ifelses(const ast::stmt_list::ptr& stmt); void decompile_aborts(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool; + void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); + auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; + auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; + auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; void process_stack(const ast::decl_thread::ptr& thread); void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); void process_stmt(const ast::stmt& stmt, const block::ptr& blk); diff --git a/src/iw7/xsk/lexer.cpp b/src/iw7/xsk/lexer.cpp index 90bcf6bb..3eccfe01 100644 --- a/src/iw7/xsk/lexer.cpp +++ b/src/iw7/xsk/lexer.cpp @@ -96,7 +96,7 @@ void reader::init(const char* data, size_t size) { state = reader::ok; buffer_pos = data; - bytes_remaining = size; + bytes_remaining = static_cast(size); last_byte = 0; current_byte = *data; } diff --git a/src/iw7/xsk/parser.cpp b/src/iw7/xsk/parser.cpp index 92a87a5c..e6be8d5c 100644 --- a/src/iw7/xsk/parser.cpp +++ b/src/iw7/xsk/parser.cpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -35,7 +35,7 @@ // private implementation details that can be changed or removed. // "%code top" blocks. -#line 34 "parser.ypp" +#line 38 "parser.ypp" #include "stdafx.hpp" #include "parser.hpp" @@ -166,9 +166,9 @@ namespace xsk { namespace gsc { namespace iw7 { parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -1451,7 +1451,7 @@ namespace xsk { namespace gsc { namespace iw7 { } void - parser::yypop_ (int n) + parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -1494,13 +1494,13 @@ namespace xsk { namespace gsc { namespace iw7 { } bool - parser::yy_pact_value_is_default_ (int yyvalue) + parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - parser::yy_table_value_is_error_ (int yyvalue) + parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -1531,8 +1531,8 @@ namespace xsk { namespace gsc { namespace iw7 { /// The return value of parse (). int yyresult; - /// Discard the LAC context in case there still is one left from a - /// previous invocation. + // Discard the LAC context in case there still is one left from a + // previous invocation. yy_lac_discard_ ("init"); #if YY_EXCEPTIONS @@ -1610,7 +1610,7 @@ namespace xsk { namespace gsc { namespace iw7 { if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) { if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; goto yydefault; } @@ -1621,7 +1621,7 @@ namespace xsk { namespace gsc { namespace iw7 { if (yy_table_value_is_error_ (yyn)) goto yyerrlab; if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -1964,1297 +1964,1297 @@ namespace xsk { namespace gsc { namespace iw7 { switch (yyn) { case 2: // root: program -#line 253 "parser.ypp" +#line 257 "parser.ypp" { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } #line 1970 "parser.cpp" break; case 3: // root: %empty -#line 254 "parser.ypp" +#line 258 "parser.ypp" { ast = std::make_unique(yylhs.location); } #line 1976 "parser.cpp" break; case 4: // program: program inline -#line 259 "parser.ypp" +#line 263 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } #line 1982 "parser.cpp" break; case 5: // program: program include -#line 261 "parser.ypp" +#line 265 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 1988 "parser.cpp" break; case 6: // program: program declaration -#line 263 "parser.ypp" +#line 267 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 1994 "parser.cpp" break; case 7: // program: inline -#line 265 "parser.ypp" +#line 269 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } #line 2000 "parser.cpp" break; case 8: // program: include -#line 267 "parser.ypp" +#line 271 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2006 "parser.cpp" break; case 9: // program: declaration -#line 269 "parser.ypp" +#line 273 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2012 "parser.cpp" break; case 10: // inline: "#inline" expr_path ";" -#line 273 "parser.ypp" +#line 277 "parser.ypp" { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } #line 2018 "parser.cpp" break; case 11: // include: "#include" expr_path ";" -#line 278 "parser.ypp" +#line 282 "parser.ypp" { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } #line 2024 "parser.cpp" break; case 12: // declaration: "/#" -#line 282 "parser.ypp" +#line 286 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } #line 2030 "parser.cpp" break; case 13: // declaration: "#/" -#line 283 "parser.ypp" +#line 287 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } #line 2036 "parser.cpp" break; case 14: // declaration: decl_usingtree -#line 284 "parser.ypp" +#line 288 "parser.ypp" { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } #line 2042 "parser.cpp" break; case 15: // declaration: decl_constant -#line 285 "parser.ypp" +#line 289 "parser.ypp" { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } #line 2048 "parser.cpp" break; case 16: // declaration: decl_thread -#line 286 "parser.ypp" +#line 290 "parser.ypp" { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } #line 2054 "parser.cpp" break; case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 291 "parser.ypp" +#line 295 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_usingtree::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_string::ptr > ())); } #line 2060 "parser.cpp" break; case 18: // decl_constant: expr_identifier "=" expr ";" -#line 296 "parser.ypp" +#line 300 "parser.ypp" { yylhs.value.as < ast::decl_constant::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 2066 "parser.cpp" break; case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 301 "parser.ypp" +#line 305 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2072 "parser.cpp" break; case 20: // stmt: stmt_block -#line 305 "parser.ypp" +#line 309 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } #line 2078 "parser.cpp" break; case 21: // stmt: stmt_call -#line 306 "parser.ypp" +#line 310 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } #line 2084 "parser.cpp" break; case 22: // stmt: stmt_assign -#line 307 "parser.ypp" +#line 311 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } #line 2090 "parser.cpp" break; case 23: // stmt: stmt_endon -#line 308 "parser.ypp" +#line 312 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } #line 2096 "parser.cpp" break; case 24: // stmt: stmt_notify -#line 309 "parser.ypp" +#line 313 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } #line 2102 "parser.cpp" break; case 25: // stmt: stmt_wait -#line 310 "parser.ypp" +#line 314 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } #line 2108 "parser.cpp" break; case 26: // stmt: stmt_waittill -#line 311 "parser.ypp" +#line 315 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } #line 2114 "parser.cpp" break; case 27: // stmt: stmt_waittillmatch -#line 312 "parser.ypp" +#line 316 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } #line 2120 "parser.cpp" break; case 28: // stmt: stmt_waittillframeend -#line 313 "parser.ypp" +#line 317 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } #line 2126 "parser.cpp" break; case 29: // stmt: stmt_if -#line 314 "parser.ypp" +#line 318 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } #line 2132 "parser.cpp" break; case 30: // stmt: stmt_ifelse -#line 315 "parser.ypp" +#line 319 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } #line 2138 "parser.cpp" break; case 31: // stmt: stmt_while -#line 316 "parser.ypp" +#line 320 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } #line 2144 "parser.cpp" break; case 32: // stmt: stmt_dowhile -#line 317 "parser.ypp" +#line 321 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } #line 2150 "parser.cpp" break; case 33: // stmt: stmt_for -#line 318 "parser.ypp" +#line 322 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } #line 2156 "parser.cpp" break; case 34: // stmt: stmt_foreach -#line 319 "parser.ypp" +#line 323 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } #line 2162 "parser.cpp" break; case 35: // stmt: stmt_switch -#line 320 "parser.ypp" +#line 324 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } #line 2168 "parser.cpp" break; case 36: // stmt: stmt_case -#line 321 "parser.ypp" +#line 325 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } #line 2174 "parser.cpp" break; case 37: // stmt: stmt_default -#line 322 "parser.ypp" +#line 326 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } #line 2180 "parser.cpp" break; case 38: // stmt: stmt_break -#line 323 "parser.ypp" +#line 327 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } #line 2186 "parser.cpp" break; case 39: // stmt: stmt_continue -#line 324 "parser.ypp" +#line 328 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } #line 2192 "parser.cpp" break; case 40: // stmt: stmt_return -#line 325 "parser.ypp" +#line 329 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } #line 2198 "parser.cpp" break; case 41: // stmt: stmt_breakpoint -#line 326 "parser.ypp" +#line 330 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } #line 2204 "parser.cpp" break; case 42: // stmt: stmt_prof_begin -#line 327 "parser.ypp" +#line 331 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } #line 2210 "parser.cpp" break; case 43: // stmt: stmt_prof_end -#line 328 "parser.ypp" +#line 332 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } #line 2216 "parser.cpp" break; case 44: // stmt_or_dev: stmt -#line 332 "parser.ypp" +#line 336 "parser.ypp" { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } #line 2222 "parser.cpp" break; case 45: // stmt_or_dev: stmt_dev -#line 333 "parser.ypp" +#line 337 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } #line 2228 "parser.cpp" break; case 46: // stmt_list: stmt_list stmt -#line 338 "parser.ypp" +#line 342 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2234 "parser.cpp" break; case 47: // stmt_list: stmt -#line 340 "parser.ypp" +#line 344 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2240 "parser.cpp" break; case 48: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 345 "parser.ypp" +#line 349 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2246 "parser.cpp" break; case 49: // stmt_or_dev_list: stmt_or_dev -#line 347 "parser.ypp" +#line 351 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2252 "parser.cpp" break; case 50: // stmt_dev: "/#" stmt_list "#/" -#line 351 "parser.ypp" +#line 355 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::stmt_list::ptr > ())); } #line 2258 "parser.cpp" break; case 51: // stmt_dev: "/#" "#/" -#line 352 "parser.ypp" +#line 356 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2264 "parser.cpp" break; case 52: // stmt_block: "{" stmt_or_dev_list "}" -#line 356 "parser.ypp" +#line 360 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } #line 2270 "parser.cpp" break; case 53: // stmt_block: "{" "}" -#line 357 "parser.ypp" +#line 361 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } #line 2276 "parser.cpp" break; case 54: // stmt_expr: expr_assign -#line 362 "parser.ypp" +#line 366 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2282 "parser.cpp" break; case 55: // stmt_expr: expr_increment -#line 364 "parser.ypp" +#line 368 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2288 "parser.cpp" break; case 56: // stmt_expr: expr_decrement -#line 366 "parser.ypp" +#line 370 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2294 "parser.cpp" break; case 57: // stmt_expr: %empty -#line 368 "parser.ypp" +#line 372 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2300 "parser.cpp" break; case 58: // stmt_call: expr_call ";" -#line 373 "parser.ypp" +#line 377 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_call::ptr > ()))); } #line 2306 "parser.cpp" break; case 59: // stmt_call: expr_method ";" -#line 375 "parser.ypp" +#line 379 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_method::ptr > ()))); } #line 2312 "parser.cpp" break; case 60: // stmt_assign: expr_assign ";" -#line 380 "parser.ypp" +#line 384 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2318 "parser.cpp" break; case 61: // stmt_assign: expr_increment ";" -#line 382 "parser.ypp" +#line 386 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2324 "parser.cpp" break; case 62: // stmt_assign: expr_decrement ";" -#line 384 "parser.ypp" +#line 388 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2330 "parser.cpp" break; case 63: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 389 "parser.ypp" +#line 393 "parser.ypp" { yylhs.value.as < ast::stmt_endon::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ())); } #line 2336 "parser.cpp" break; case 64: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 394 "parser.ypp" +#line 398 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2342 "parser.cpp" break; case 65: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 396 "parser.ypp" +#line 400 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2348 "parser.cpp" break; case 66: // stmt_wait: "wait" expr ";" -#line 401 "parser.ypp" +#line 405 "parser.ypp" { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2354 "parser.cpp" break; case 67: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 406 "parser.ypp" +#line 410 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2360 "parser.cpp" break; case 68: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 408 "parser.ypp" +#line 412 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2366 "parser.cpp" break; case 69: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 413 "parser.ypp" +#line 417 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2372 "parser.cpp" break; case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 415 "parser.ypp" +#line 419 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2378 "parser.cpp" break; case 71: // stmt_waittillframeend: "waittillframeend" ";" -#line 420 "parser.ypp" +#line 424 "parser.ypp" { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } #line 2384 "parser.cpp" break; case 72: // stmt_if: "if" "(" expr ")" stmt -#line 425 "parser.ypp" +#line 429 "parser.ypp" { yylhs.value.as < ast::stmt_if::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2390 "parser.cpp" break; case 73: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 430 "parser.ypp" +#line 434 "parser.ypp" { yylhs.value.as < ast::stmt_ifelse::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::stmt > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2396 "parser.cpp" break; case 74: // stmt_while: "while" "(" expr ")" stmt -#line 435 "parser.ypp" +#line 439 "parser.ypp" { yylhs.value.as < ast::stmt_while::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2402 "parser.cpp" break; case 75: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 440 "parser.ypp" +#line 444 "parser.ypp" { yylhs.value.as < ast::stmt_dowhile::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[5].value.as < ast::stmt > ())); } #line 2408 "parser.cpp" break; case 76: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 445 "parser.ypp" +#line 449 "parser.ypp" { yylhs.value.as < ast::stmt_for::ptr > () = std::make_unique(yylhs.location, ast::stmt(std::move(yystack_[6].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[4].value.as < ast::expr > ()), ast::stmt(std::move(yystack_[2].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2414 "parser.cpp" break; case 77: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 450 "parser.ypp" +#line 454 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2420 "parser.cpp" break; case 78: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 452 "parser.ypp" +#line 456 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[6].value.as < ast::expr_identifier::ptr > ())), ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2426 "parser.cpp" break; case 79: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 457 "parser.ypp" +#line 461 "parser.ypp" { yylhs.value.as < ast::stmt_switch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2432 "parser.cpp" break; case 80: // stmt_case: "case" expr_integer ":" -#line 462 "parser.ypp" +#line 466 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_integer::ptr > ())), std::make_unique(yylhs.location)); } #line 2438 "parser.cpp" break; case 81: // stmt_case: "case" expr_string ":" -#line 464 "parser.ypp" +#line 468 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_string::ptr > ())), std::make_unique(yylhs.location)); } #line 2444 "parser.cpp" break; case 82: // stmt_default: "default" ":" -#line 469 "parser.ypp" +#line 473 "parser.ypp" { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2450 "parser.cpp" break; case 83: // stmt_break: "break" ";" -#line 474 "parser.ypp" +#line 478 "parser.ypp" { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } #line 2456 "parser.cpp" break; case 84: // stmt_continue: "continue" ";" -#line 479 "parser.ypp" +#line 483 "parser.ypp" { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } #line 2462 "parser.cpp" break; case 85: // stmt_return: "return" expr ";" -#line 484 "parser.ypp" +#line 488 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2468 "parser.cpp" break; case 86: // stmt_return: "return" ";" -#line 486 "parser.ypp" +#line 490 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2474 "parser.cpp" break; case 87: // stmt_breakpoint: "breakpoint" ";" -#line 491 "parser.ypp" +#line 495 "parser.ypp" { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } #line 2480 "parser.cpp" break; case 88: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 496 "parser.ypp" +#line 500 "parser.ypp" { yylhs.value.as < ast::stmt_prof_begin::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2486 "parser.cpp" break; case 89: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 501 "parser.ypp" +#line 505 "parser.ypp" { yylhs.value.as < ast::stmt_prof_end::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2492 "parser.cpp" break; case 90: // expr: expr_ternary -#line 505 "parser.ypp" +#line 509 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2498 "parser.cpp" break; case 91: // expr: expr_binary -#line 506 "parser.ypp" +#line 510 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2504 "parser.cpp" break; case 92: // expr: expr_primitive -#line 507 "parser.ypp" +#line 511 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2510 "parser.cpp" break; case 93: // expr_or_empty: expr -#line 511 "parser.ypp" +#line 515 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2516 "parser.cpp" break; case 94: // expr_or_empty: %empty -#line 512 "parser.ypp" +#line 516 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } #line 2522 "parser.cpp" break; case 95: // expr_assign: expr_object "=" expr -#line 517 "parser.ypp" +#line 521 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2528 "parser.cpp" break; case 96: // expr_assign: expr_object "|=" expr -#line 519 "parser.ypp" +#line 523 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2534 "parser.cpp" break; case 97: // expr_assign: expr_object "&=" expr -#line 521 "parser.ypp" +#line 525 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2540 "parser.cpp" break; case 98: // expr_assign: expr_object "^=" expr -#line 523 "parser.ypp" +#line 527 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2546 "parser.cpp" break; case 99: // expr_assign: expr_object "<<=" expr -#line 525 "parser.ypp" +#line 529 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()),std::move( yystack_[0].value.as < ast::expr > ())); } #line 2552 "parser.cpp" break; case 100: // expr_assign: expr_object ">>=" expr -#line 527 "parser.ypp" +#line 531 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2558 "parser.cpp" break; case 101: // expr_assign: expr_object "+=" expr -#line 529 "parser.ypp" +#line 533 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2564 "parser.cpp" break; case 102: // expr_assign: expr_object "-=" expr -#line 531 "parser.ypp" +#line 535 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2570 "parser.cpp" break; case 103: // expr_assign: expr_object "*=" expr -#line 533 "parser.ypp" +#line 537 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2576 "parser.cpp" break; case 104: // expr_assign: expr_object "/=" expr -#line 535 "parser.ypp" +#line 539 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2582 "parser.cpp" break; case 105: // expr_assign: expr_object "%=" expr -#line 537 "parser.ypp" +#line 541 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2588 "parser.cpp" break; case 106: // expr_increment: "++" expr_object -#line 542 "parser.ypp" +#line 546 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2594 "parser.cpp" break; case 107: // expr_increment: expr_object "++" -#line 544 "parser.ypp" +#line 548 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2600 "parser.cpp" break; case 108: // expr_decrement: "--" expr_object -#line 549 "parser.ypp" +#line 553 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2606 "parser.cpp" break; case 109: // expr_decrement: expr_object "--" -#line 551 "parser.ypp" +#line 555 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2612 "parser.cpp" break; case 110: // expr_ternary: expr "?" expr ":" expr -#line 556 "parser.ypp" +#line 560 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2618 "parser.cpp" break; case 111: // expr_binary: expr "||" expr -#line 561 "parser.ypp" +#line 565 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2624 "parser.cpp" break; case 112: // expr_binary: expr "&&" expr -#line 563 "parser.ypp" +#line 567 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2630 "parser.cpp" break; case 113: // expr_binary: expr "==" expr -#line 565 "parser.ypp" +#line 569 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2636 "parser.cpp" break; case 114: // expr_binary: expr "!=" expr -#line 567 "parser.ypp" +#line 571 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2642 "parser.cpp" break; case 115: // expr_binary: expr "<=" expr -#line 569 "parser.ypp" +#line 573 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2648 "parser.cpp" break; case 116: // expr_binary: expr ">=" expr -#line 571 "parser.ypp" +#line 575 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2654 "parser.cpp" break; case 117: // expr_binary: expr "<" expr -#line 573 "parser.ypp" +#line 577 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2660 "parser.cpp" break; case 118: // expr_binary: expr ">" expr -#line 575 "parser.ypp" +#line 579 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2666 "parser.cpp" break; case 119: // expr_binary: expr "|" expr -#line 577 "parser.ypp" +#line 581 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2672 "parser.cpp" break; case 120: // expr_binary: expr "&" expr -#line 579 "parser.ypp" +#line 583 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2678 "parser.cpp" break; case 121: // expr_binary: expr "^" expr -#line 581 "parser.ypp" +#line 585 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2684 "parser.cpp" break; case 122: // expr_binary: expr "<<" expr -#line 583 "parser.ypp" +#line 587 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2690 "parser.cpp" break; case 123: // expr_binary: expr ">>" expr -#line 585 "parser.ypp" +#line 589 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2696 "parser.cpp" break; case 124: // expr_binary: expr "+" expr -#line 587 "parser.ypp" +#line 591 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2702 "parser.cpp" break; case 125: // expr_binary: expr "-" expr -#line 589 "parser.ypp" +#line 593 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2708 "parser.cpp" break; case 126: // expr_binary: expr "*" expr -#line 591 "parser.ypp" +#line 595 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2714 "parser.cpp" break; case 127: // expr_binary: expr "/" expr -#line 593 "parser.ypp" +#line 597 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2720 "parser.cpp" break; case 128: // expr_binary: expr "%" expr -#line 595 "parser.ypp" +#line 599 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2726 "parser.cpp" break; case 129: // expr_primitive: expr_complement -#line 599 "parser.ypp" +#line 603 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } #line 2732 "parser.cpp" break; case 130: // expr_primitive: expr_not -#line 600 "parser.ypp" +#line 604 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } #line 2738 "parser.cpp" break; case 131: // expr_primitive: expr_call -#line 601 "parser.ypp" +#line 605 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 2744 "parser.cpp" break; case 132: // expr_primitive: expr_method -#line 602 "parser.ypp" +#line 606 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 2750 "parser.cpp" break; case 133: // expr_primitive: expr_add_array -#line 603 "parser.ypp" +#line 607 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } #line 2756 "parser.cpp" break; case 134: // expr_primitive: expr_reference -#line 604 "parser.ypp" +#line 608 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } #line 2762 "parser.cpp" break; case 135: // expr_primitive: expr_array -#line 605 "parser.ypp" +#line 609 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 2768 "parser.cpp" break; case 136: // expr_primitive: expr_field -#line 606 "parser.ypp" +#line 610 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 2774 "parser.cpp" break; case 137: // expr_primitive: expr_size -#line 607 "parser.ypp" +#line 611 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } #line 2780 "parser.cpp" break; case 138: // expr_primitive: expr_paren -#line 608 "parser.ypp" +#line 612 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } #line 2786 "parser.cpp" break; case 139: // expr_primitive: expr_thisthread -#line 609 "parser.ypp" +#line 613 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } #line 2792 "parser.cpp" break; case 140: // expr_primitive: expr_empty_array -#line 610 "parser.ypp" +#line 614 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } #line 2798 "parser.cpp" break; case 141: // expr_primitive: expr_undefined -#line 611 "parser.ypp" +#line 615 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } #line 2804 "parser.cpp" break; case 142: // expr_primitive: expr_game -#line 612 "parser.ypp" +#line 616 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 2810 "parser.cpp" break; case 143: // expr_primitive: expr_self -#line 613 "parser.ypp" +#line 617 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 2816 "parser.cpp" break; case 144: // expr_primitive: expr_anim -#line 614 "parser.ypp" +#line 618 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 2822 "parser.cpp" break; case 145: // expr_primitive: expr_level -#line 615 "parser.ypp" +#line 619 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 2828 "parser.cpp" break; case 146: // expr_primitive: expr_animation -#line 616 "parser.ypp" +#line 620 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } #line 2834 "parser.cpp" break; case 147: // expr_primitive: expr_animtree -#line 617 "parser.ypp" +#line 621 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } #line 2840 "parser.cpp" break; case 148: // expr_primitive: expr_identifier -#line 618 "parser.ypp" +#line 622 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 2846 "parser.cpp" break; case 149: // expr_primitive: expr_istring -#line 619 "parser.ypp" +#line 623 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } #line 2852 "parser.cpp" break; case 150: // expr_primitive: expr_string -#line 620 "parser.ypp" +#line 624 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } #line 2858 "parser.cpp" break; case 151: // expr_primitive: expr_vector -#line 621 "parser.ypp" +#line 625 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } #line 2864 "parser.cpp" break; case 152: // expr_primitive: expr_float -#line 622 "parser.ypp" +#line 626 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } #line 2870 "parser.cpp" break; case 153: // expr_primitive: expr_integer -#line 623 "parser.ypp" +#line 627 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } #line 2876 "parser.cpp" break; case 154: // expr_primitive: expr_false -#line 624 "parser.ypp" +#line 628 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } #line 2882 "parser.cpp" break; case 155: // expr_primitive: expr_true -#line 625 "parser.ypp" +#line 629 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } #line 2888 "parser.cpp" break; case 156: // expr_complement: "~" expr -#line 630 "parser.ypp" +#line 634 "parser.ypp" { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2894 "parser.cpp" break; case 157: // expr_not: "!" expr -#line 635 "parser.ypp" +#line 639 "parser.ypp" { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2900 "parser.cpp" break; case 158: // expr_call: expr_function -#line 639 "parser.ypp" +#line 643 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2906 "parser.cpp" break; case 159: // expr_call: expr_pointer -#line 640 "parser.ypp" +#line 644 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2912 "parser.cpp" break; case 160: // expr_method: expr_object expr_function -#line 643 "parser.ypp" +#line 647 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 2918 "parser.cpp" break; case 161: // expr_method: expr_object expr_pointer -#line 644 "parser.ypp" +#line 648 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 2924 "parser.cpp" break; case 162: // expr_function: expr_identifier "(" expr_arguments ")" -#line 649 "parser.ypp" +#line 653 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2930 "parser.cpp" break; case 163: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 651 "parser.ypp" +#line 655 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2936 "parser.cpp" break; case 164: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 653 "parser.ypp" +#line 657 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2942 "parser.cpp" break; case 165: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 655 "parser.ypp" +#line 659 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2948 "parser.cpp" break; case 166: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 657 "parser.ypp" +#line 661 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2954 "parser.cpp" break; case 167: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 659 "parser.ypp" +#line 663 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2960 "parser.cpp" break; case 168: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 664 "parser.ypp" +#line 668 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2966 "parser.cpp" break; case 169: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 666 "parser.ypp" +#line 670 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2972 "parser.cpp" break; case 170: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 668 "parser.ypp" +#line 672 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2978 "parser.cpp" break; case 171: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 670 "parser.ypp" +#line 674 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::builtin); } #line 2984 "parser.cpp" break; case 172: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 675 "parser.ypp" +#line 679 "parser.ypp" { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } #line 2990 "parser.cpp" break; case 173: // expr_parameters: expr_parameters "," expr_identifier -#line 680 "parser.ypp" +#line 684 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 2996 "parser.cpp" break; case 174: // expr_parameters: expr_identifier -#line 682 "parser.ypp" +#line 686 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3002 "parser.cpp" break; case 175: // expr_parameters: %empty -#line 684 "parser.ypp" +#line 688 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } #line 3008 "parser.cpp" break; case 176: // expr_arguments: expr_arguments_no_empty -#line 689 "parser.ypp" +#line 693 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } #line 3014 "parser.cpp" break; case 177: // expr_arguments: %empty -#line 691 "parser.ypp" +#line 695 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } #line 3020 "parser.cpp" break; case 178: // expr_arguments_no_empty: expr_arguments "," expr -#line 696 "parser.ypp" +#line 700 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ()); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3026 "parser.cpp" break; case 179: // expr_arguments_no_empty: expr -#line 698 "parser.ypp" +#line 702 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3032 "parser.cpp" break; case 180: // expr_reference: "::" expr_identifier -#line 703 "parser.ypp" +#line 707 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3038 "parser.cpp" break; case 181: // expr_reference: expr_path "::" expr_identifier -#line 705 "parser.ypp" +#line 709 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_path::ptr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3044 "parser.cpp" break; case 182: // expr_array: expr_object "[" expr "]" -#line 710 "parser.ypp" +#line 714 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3050 "parser.cpp" break; case 183: // expr_field: expr_object "." expr_identifier_nosize -#line 715 "parser.ypp" +#line 719 "parser.ypp" { yylhs.value.as < ast::expr_field::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3056 "parser.cpp" break; case 184: // expr_size: expr_object "." "size" -#line 720 "parser.ypp" +#line 724 "parser.ypp" { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } #line 3062 "parser.cpp" break; case 185: // expr_paren: "(" expr ")" -#line 725 "parser.ypp" +#line 729 "parser.ypp" { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3068 "parser.cpp" break; case 186: // expr_object: expr_call -#line 729 "parser.ypp" +#line 733 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 3074 "parser.cpp" break; case 187: // expr_object: expr_method -#line 730 "parser.ypp" +#line 734 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 3080 "parser.cpp" break; case 188: // expr_object: expr_array -#line 731 "parser.ypp" +#line 735 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 3086 "parser.cpp" break; case 189: // expr_object: expr_field -#line 732 "parser.ypp" +#line 736 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 3092 "parser.cpp" break; case 190: // expr_object: expr_game -#line 733 "parser.ypp" +#line 737 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 3098 "parser.cpp" break; case 191: // expr_object: expr_self -#line 734 "parser.ypp" +#line 738 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 3104 "parser.cpp" break; case 192: // expr_object: expr_anim -#line 735 "parser.ypp" +#line 739 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 3110 "parser.cpp" break; case 193: // expr_object: expr_level -#line 736 "parser.ypp" +#line 740 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 3116 "parser.cpp" break; case 194: // expr_object: expr_identifier -#line 737 "parser.ypp" +#line 741 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 3122 "parser.cpp" break; case 195: // expr_thisthread: "thisthread" -#line 742 "parser.ypp" +#line 746 "parser.ypp" { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } #line 3128 "parser.cpp" break; case 196: // expr_empty_array: "[" "]" -#line 747 "parser.ypp" +#line 751 "parser.ypp" { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } #line 3134 "parser.cpp" break; case 197: // expr_undefined: "undefined" -#line 752 "parser.ypp" +#line 756 "parser.ypp" { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } #line 3140 "parser.cpp" break; case 198: // expr_game: "game" -#line 757 "parser.ypp" +#line 761 "parser.ypp" { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } #line 3146 "parser.cpp" break; case 199: // expr_self: "self" -#line 762 "parser.ypp" +#line 766 "parser.ypp" { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } #line 3152 "parser.cpp" break; case 200: // expr_anim: "anim" -#line 767 "parser.ypp" +#line 771 "parser.ypp" { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } #line 3158 "parser.cpp" break; case 201: // expr_level: "level" -#line 772 "parser.ypp" +#line 776 "parser.ypp" { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } #line 3164 "parser.cpp" break; case 202: // expr_animation: "%" "identifier" -#line 777 "parser.ypp" +#line 781 "parser.ypp" { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3170 "parser.cpp" break; case 203: // expr_animtree: "#animtree" -#line 782 "parser.ypp" +#line 786 "parser.ypp" { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } #line 3176 "parser.cpp" break; case 204: // expr_identifier_nosize: "identifier" -#line 787 "parser.ypp" +#line 791 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3182 "parser.cpp" break; case 205: // expr_identifier: "identifier" -#line 792 "parser.ypp" +#line 796 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3188 "parser.cpp" break; case 206: // expr_identifier: "size" -#line 794 "parser.ypp" +#line 798 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } #line 3194 "parser.cpp" break; case 207: // expr_path: "identifier" -#line 799 "parser.ypp" +#line 803 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3200 "parser.cpp" break; case 208: // expr_path: "path" -#line 801 "parser.ypp" +#line 805 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3206 "parser.cpp" break; case 209: // expr_istring: "localized string" -#line 806 "parser.ypp" +#line 810 "parser.ypp" { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3212 "parser.cpp" break; case 210: // expr_string: "string literal" -#line 811 "parser.ypp" +#line 815 "parser.ypp" { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3218 "parser.cpp" break; case 211: // expr_vector: "(" expr "," expr "," expr ")" -#line 816 "parser.ypp" +#line 820 "parser.ypp" { yylhs.value.as < ast::expr_vector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3224 "parser.cpp" break; case 212: // expr_float: "-" "float" -#line 821 "parser.ypp" +#line 825 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3230 "parser.cpp" break; case 213: // expr_float: "float" -#line 823 "parser.ypp" +#line 827 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3236 "parser.cpp" break; case 214: // expr_integer: "-" "integer" -#line 828 "parser.ypp" +#line 832 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3242 "parser.cpp" break; case 215: // expr_integer: "integer" -#line 830 "parser.ypp" +#line 834 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3248 "parser.cpp" break; case 216: // expr_false: "false" -#line 835 "parser.ypp" +#line 839 "parser.ypp" { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } #line 3254 "parser.cpp" break; case 217: // expr_true: "true" -#line 840 "parser.ypp" +#line 844 "parser.ypp" { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } #line 3260 "parser.cpp" break; @@ -3523,6 +3523,8 @@ namespace xsk { namespace gsc { namespace iw7 { } + + bool parser::yy_lac_check_ (symbol_kind_type yytoken) const { @@ -3627,7 +3629,9 @@ namespace xsk { namespace gsc { namespace iw7 { follows. If no initial context is currently established for the current lookahead, then check if that lookahead can eventually be shifted if syntactic actions continue from the current context. */ - if (!yy_lac_established_) + if (yy_lac_established_) + return true; + else { #if IW7DEBUG YYCDEBUG << "LAC: initial context established for " @@ -3636,12 +3640,11 @@ namespace xsk { namespace gsc { namespace iw7 { yy_lac_established_ = true; return yy_lac_check_ (yytoken); } - return true; } // Discard any previous initial lookahead context. void - parser::yy_lac_discard_ (const char* evt) + parser::yy_lac_discard_ (const char* event) { /* Discard any previous initial lookahead context because of Event, which may be a lookahead change or an invalidation of the currently @@ -3657,11 +3660,12 @@ namespace xsk { namespace gsc { namespace iw7 { if (yy_lac_established_) { YYCDEBUG << "LAC: initial context discarded due to " - << evt << '\n'; + << event << '\n'; yy_lac_established_ = false; } } + int parser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -4453,28 +4457,28 @@ namespace xsk { namespace gsc { namespace iw7 { const short parser::yyrline_[] = { - 0, 253, 253, 254, 258, 260, 262, 264, 266, 268, - 273, 277, 282, 283, 284, 285, 286, 290, 295, 300, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 332, 333, 337, 339, 344, 346, - 351, 352, 356, 357, 361, 363, 365, 368, 372, 374, - 379, 381, 383, 388, 393, 395, 400, 405, 407, 412, - 414, 419, 424, 429, 434, 439, 444, 449, 451, 456, - 461, 463, 468, 473, 478, 483, 485, 490, 495, 500, - 505, 506, 507, 511, 512, 516, 518, 520, 522, 524, - 526, 528, 530, 532, 534, 536, 541, 543, 548, 550, - 555, 560, 562, 564, 566, 568, 570, 572, 574, 576, - 578, 580, 582, 584, 586, 588, 590, 592, 594, 599, - 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, - 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, - 620, 621, 622, 623, 624, 625, 629, 634, 639, 640, - 643, 644, 648, 650, 652, 654, 656, 658, 663, 665, - 667, 669, 674, 679, 681, 684, 688, 691, 695, 697, - 702, 704, 709, 714, 719, 724, 729, 730, 731, 732, - 733, 734, 735, 736, 737, 741, 746, 751, 756, 761, - 766, 771, 776, 781, 786, 791, 793, 798, 800, 805, - 810, 815, 820, 822, 827, 829, 834, 839 + 0, 257, 257, 258, 262, 264, 266, 268, 270, 272, + 277, 281, 286, 287, 288, 289, 290, 294, 299, 304, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 336, 337, 341, 343, 348, 350, + 355, 356, 360, 361, 365, 367, 369, 372, 376, 378, + 383, 385, 387, 392, 397, 399, 404, 409, 411, 416, + 418, 423, 428, 433, 438, 443, 448, 453, 455, 460, + 465, 467, 472, 477, 482, 487, 489, 494, 499, 504, + 509, 510, 511, 515, 516, 520, 522, 524, 526, 528, + 530, 532, 534, 536, 538, 540, 545, 547, 552, 554, + 559, 564, 566, 568, 570, 572, 574, 576, 578, 580, + 582, 584, 586, 588, 590, 592, 594, 596, 598, 603, + 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 633, 638, 643, 644, + 647, 648, 652, 654, 656, 658, 660, 662, 667, 669, + 671, 673, 678, 683, 685, 688, 692, 695, 699, 701, + 706, 708, 713, 718, 723, 728, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 745, 750, 755, 760, 765, + 770, 775, 780, 785, 790, 795, 797, 802, 804, 809, + 814, 819, 824, 826, 831, 833, 838, 843 }; void @@ -4507,9 +4511,9 @@ namespace xsk { namespace gsc { namespace iw7 { #line 13 "parser.ypp" } } } // xsk::gsc::iw7 -#line 4511 "parser.cpp" +#line 4515 "parser.cpp" -#line 843 "parser.ypp" +#line 847 "parser.ypp" void xsk::gsc::iw7::parser::error(const xsk::gsc::location& loc, const std::string& msg) diff --git a/src/iw7/xsk/parser.hpp b/src/iw7/xsk/parser.hpp index 80bae2d9..2044b21c 100644 --- a/src/iw7/xsk/parser.hpp +++ b/src/iw7/xsk/parser.hpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -47,10 +47,14 @@ // "%code requires" blocks. #line 28 "parser.ypp" +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "iw7.hpp" namespace xsk::gsc::iw7 { class lexer; } -#line 54 "parser.hpp" +#line 58 "parser.hpp" # include # include // std::abort @@ -126,12 +130,18 @@ namespace xsk::gsc::iw7 { class lexer; } # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -193,7 +203,7 @@ namespace xsk::gsc::iw7 { class lexer; } #line 13 "parser.ypp" namespace xsk { namespace gsc { namespace iw7 { -#line 197 "parser.hpp" +#line 207 "parser.hpp" @@ -202,27 +212,32 @@ namespace xsk { namespace gsc { namespace iw7 { class parser { public: -#ifndef IW7STYPE +#ifdef IW7STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define IW7STYPE in C++, use %define api.value.type" +# endif + typedef IW7STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { IW7_ASSERT (sizeof (T) <= size); @@ -231,13 +246,13 @@ namespace xsk { namespace gsc { namespace iw7 { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { IW7_ASSERT (!yytypeid_); } @@ -381,7 +396,7 @@ namespace xsk { namespace gsc { namespace iw7 { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -391,7 +406,7 @@ namespace xsk { namespace gsc { namespace iw7 { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -400,7 +415,7 @@ namespace xsk { namespace gsc { namespace iw7 { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -632,18 +647,19 @@ namespace xsk { namespace gsc { namespace iw7 { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef IW7STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef xsk::gsc::location location_type; @@ -789,7 +805,7 @@ namespace xsk { namespace gsc { namespace iw7 { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -1017,7 +1033,7 @@ namespace xsk { namespace gsc { namespace iw7 { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -2267,6 +2283,8 @@ namespace xsk { namespace gsc { namespace iw7 { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -2589,7 +2607,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -2604,22 +2622,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { - /// Default constructor. - by_kind (); - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that); -#endif - - /// Copy constructor. - by_kind (const by_kind& that); - /// The symbol kind as needed by the constructor. typedef token_kind_type kind_type; + /// Default constructor. + by_kind () YY_NOEXCEPT; + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that) YY_NOEXCEPT; +#endif + + /// Copy constructor. + by_kind (const by_kind& that) YY_NOEXCEPT; + /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -2649,30 +2669,34 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ IW7_ASSERT (tok == token::IW7EOF || (token::IW7error <= tok && tok <= token::MOD) || (token::SIZEOF <= tok && tok <= token::POSTDEC)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ IW7_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); +#endif } }; @@ -2721,7 +2745,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static const char *symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -4458,19 +4482,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const short yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; @@ -4497,14 +4521,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const unsigned char yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const unsigned char yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -4603,7 +4627,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -4682,7 +4706,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -4741,7 +4765,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -4760,7 +4784,7 @@ switch (yykind) inline parser::symbol_kind_type - parser::yytranslate_ (int t) + parser::yytranslate_ (int t) YY_NOEXCEPT { return static_cast (t); } @@ -5065,6 +5089,7 @@ switch (yykind) + template parser::symbol_kind_type parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -5072,6 +5097,7 @@ switch (yykind) return this->kind (); } + template bool parser::basic_symbol::empty () const YY_NOEXCEPT @@ -5378,13 +5404,13 @@ switch (yykind) // by_kind. inline - parser::by_kind::by_kind () + parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - parser::by_kind::by_kind (by_kind&& that) + parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -5392,15 +5418,17 @@ switch (yykind) #endif inline - parser::by_kind::by_kind (const by_kind& that) + parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - parser::by_kind::by_kind (token_kind_type t) + parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void parser::by_kind::clear () YY_NOEXCEPT @@ -5423,6 +5451,7 @@ switch (yykind) return kind_; } + inline parser::symbol_kind_type parser::by_kind::type_get () const YY_NOEXCEPT @@ -5430,9 +5459,10 @@ switch (yykind) return this->kind (); } + #line 13 "parser.ypp" } } } // xsk::gsc::iw7 -#line 5436 "parser.hpp" +#line 5466 "parser.hpp" diff --git a/src/iw7/xsk/resolver.cpp b/src/iw7/xsk/resolver.cpp index 2aba7f5b..e7579f9c 100644 --- a/src/iw7/xsk/resolver.cpp +++ b/src/iw7/xsk/resolver.cpp @@ -6,6 +6,11 @@ #include "stdafx.hpp" #include "iw7.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4244) +#endif + namespace xsk::gsc::iw7 { @@ -61,7 +66,7 @@ auto resolver::function_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_func_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = function_map_rev.find(name); @@ -90,7 +95,7 @@ auto resolver::method_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_meth_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = method_map_rev.find(name); @@ -119,7 +124,7 @@ auto resolver::file_id(const std::string& name) -> std::uint32_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = file_map_rev.find(name); @@ -148,7 +153,7 @@ auto resolver::token_id(const std::string& name) -> std::uint32_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = token_map_rev.find(name); @@ -212,7 +217,7 @@ auto resolver::make_token(std::string_view str) -> std::string for (std::size_t i = 0; i < data.size(); i++) { - data[i] = std::tolower(str[i]); + data[i] = static_cast(std::tolower(static_cast(str[i]))); if (data[i] == '\\') data[i] = '/'; } @@ -2805,3 +2810,7 @@ struct __init__ __init__ _; } // namespace xsk::gsc::iw7 + +#ifdef _MSC_VER +#pragma warning(pop) +#endif diff --git a/src/iw8/stdafx.hpp b/src/iw8/stdafx.hpp index 6ddb5069..19f22f43 100644 --- a/src/iw8/stdafx.hpp +++ b/src/iw8/stdafx.hpp @@ -5,38 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4005) -#pragma warning(disable:4018) -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4389) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include -// Ext using namespace std::literals; - -#include "xsk/iw8.hpp" diff --git a/src/iw8/xsk/assembler.cpp b/src/iw8/xsk/assembler.cpp index 3f52100e..6d1d2a0e 100644 --- a/src/iw8/xsk/assembler.cpp +++ b/src/iw8/xsk/assembler.cpp @@ -507,7 +507,7 @@ void assembler::assemble_end_switch(const instruction::ptr& inst) const auto count = std::stoul(inst->data[0]); - script_->write(count); + script_->write(static_cast(count)); std::uint32_t index = inst->index + 3; @@ -588,15 +588,15 @@ void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back if (expr) { - script_->write(addr - inst->index - 3); + script_->write(static_cast(addr - inst->index - 3)); } else if (back) { - script_->write((inst->index + 3) - addr); + script_->write(static_cast((inst->index + 3) - addr)); } else { - script_->write(addr - inst->index - 5); + script_->write(static_cast(addr - inst->index - 5)); } } @@ -615,11 +615,11 @@ void assembler::assemble_offset(std::int32_t offset) auto assembler::resolve_function(const std::string& name) -> std::int32_t { - for (const auto& func : functions_) + for (const auto& entry : functions_) { - if (func->name == name) + if (entry->name == name) { - return func->index; + return entry->index; } } @@ -628,11 +628,11 @@ auto assembler::resolve_function(const std::string& name) -> std::int32_t auto assembler::resolve_label(const std::string& name) -> std::int32_t { - for (const auto& func : labels_) + for (const auto& entry : labels_) { - if (func.second == name) + if (entry.second == name) { - return func.first; + return entry.first; } } diff --git a/src/iw8/xsk/compiler.cpp b/src/iw8/xsk/compiler.cpp index 4af8e288..77084f03 100644 --- a/src/iw8/xsk/compiler.cpp +++ b/src/iw8/xsk/compiler.cpp @@ -848,7 +848,7 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: emit_opcode(opcode::OP_endswitch, data); - auto offset = 7 * stmt->stmt->list.size(); + auto offset = static_cast(7 * stmt->stmt->list.size()); function_->instructions.back()->size += offset; index_ += offset; @@ -1552,7 +1552,7 @@ void compiler::emit_expr_add_array(const ast::expr_add_array::ptr& expr, const b void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk) { - auto num = expr->list.size(); + auto num = static_cast(expr->list.size()); if (num) { @@ -2720,7 +2720,7 @@ auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const { if (blk->local_vars.at(i).init) { - return blk->local_vars_create_count - 1 - i; + return static_cast(blk->local_vars_create_count - 1 - i); } throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); diff --git a/src/iw8/xsk/decompiler.cpp b/src/iw8/xsk/decompiler.cpp index 29e3ecca..4d5453c8 100644 --- a/src/iw8/xsk/decompiler.cpp +++ b/src/iw8/xsk/decompiler.cpp @@ -1818,7 +1818,7 @@ void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) void decompiler::decompile_infinites(const ast::stmt_list::ptr& stmt) { - for (int i = stmt->list.size() - 1; i >= 0; i--) + for (auto i = stmt->list.size() - 1; i > 0; i--) { if (stmt->list.at(i) == ast::kind::asm_jump_back) { @@ -1981,7 +1981,7 @@ void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) } } -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_end = stmt->list.at(begin).as_cond->value; @@ -2009,7 +2009,7 @@ void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t beg stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.loc_end = stmt->list.at(end).loc().label(); @@ -2060,7 +2060,7 @@ void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.is_last = true; @@ -2120,7 +2120,7 @@ void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uin } } -void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); @@ -2150,7 +2150,7 @@ void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32 stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t start, std::uint32_t end) +void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::size_t start, std::size_t end) { auto& last = block->list.at(end - 1); @@ -2215,7 +2215,7 @@ void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t decompile_while(block, start, end); } -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2245,7 +2245,7 @@ void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2276,7 +2276,7 @@ void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2330,7 +2330,7 @@ void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t be stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2397,7 +2397,7 @@ void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t start) +void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) { block blk; blk.loc_continue = blocks_.back().loc_continue; @@ -2510,7 +2510,7 @@ void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); } -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool +auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool { for (auto i = begin; i < end; i++) { @@ -2529,7 +2529,7 @@ auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::u return false; } -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t +auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t { auto index = 0u; @@ -2547,7 +2547,7 @@ auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std: throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); } -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool +auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool { if (index == stmt->list.size() - 1) return true; @@ -3371,7 +3371,7 @@ void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) { - blk->local_vars_public_count = blk->local_vars.size() - std::stoi(expr->index); + blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); } } // namespace xsk::gsc::iw8 diff --git a/src/iw8/xsk/decompiler.hpp b/src/iw8/xsk/decompiler.hpp index 4b32d9df..de57be0d 100644 --- a/src/iw8/xsk/decompiler.hpp +++ b/src/iw8/xsk/decompiler.hpp @@ -34,19 +34,19 @@ private: void decompile_switches(const ast::stmt_list::ptr& stmt); void decompile_ifelses(const ast::stmt_list::ptr& stmt); void decompile_aborts(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool; + void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); + auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; + auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; + auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; void process_stack(const ast::decl_thread::ptr& thread); void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); void process_stmt(const ast::stmt& stmt, const block::ptr& blk); diff --git a/src/iw8/xsk/lexer.cpp b/src/iw8/xsk/lexer.cpp index e2fb0d17..62c68da4 100644 --- a/src/iw8/xsk/lexer.cpp +++ b/src/iw8/xsk/lexer.cpp @@ -99,7 +99,7 @@ void reader::init(const char* data, size_t size) { state = reader::ok; buffer_pos = data; - bytes_remaining = size; + bytes_remaining = static_cast(size); last_byte = 0; current_byte = *data; } diff --git a/src/iw8/xsk/parser.cpp b/src/iw8/xsk/parser.cpp index 59ccab73..59d15c4b 100644 --- a/src/iw8/xsk/parser.cpp +++ b/src/iw8/xsk/parser.cpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -35,7 +35,7 @@ // private implementation details that can be changed or removed. // "%code top" blocks. -#line 34 "parser.ypp" +#line 38 "parser.ypp" #include "stdafx.hpp" #include "parser.hpp" @@ -166,9 +166,9 @@ namespace xsk { namespace gsc { namespace iw8 { parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -1499,7 +1499,7 @@ namespace xsk { namespace gsc { namespace iw8 { } void - parser::yypop_ (int n) + parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -1542,13 +1542,13 @@ namespace xsk { namespace gsc { namespace iw8 { } bool - parser::yy_pact_value_is_default_ (int yyvalue) + parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - parser::yy_table_value_is_error_ (int yyvalue) + parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -1579,8 +1579,8 @@ namespace xsk { namespace gsc { namespace iw8 { /// The return value of parse (). int yyresult; - /// Discard the LAC context in case there still is one left from a - /// previous invocation. + // Discard the LAC context in case there still is one left from a + // previous invocation. yy_lac_discard_ ("init"); #if YY_EXCEPTIONS @@ -1658,7 +1658,7 @@ namespace xsk { namespace gsc { namespace iw8 { if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) { if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; goto yydefault; } @@ -1669,7 +1669,7 @@ namespace xsk { namespace gsc { namespace iw8 { if (yy_table_value_is_error_ (yyn)) goto yyerrlab; if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -2024,1339 +2024,1339 @@ namespace xsk { namespace gsc { namespace iw8 { switch (yyn) { case 2: // root: program -#line 259 "parser.ypp" +#line 263 "parser.ypp" { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } #line 2030 "parser.cpp" break; case 3: // root: %empty -#line 260 "parser.ypp" +#line 264 "parser.ypp" { ast = std::make_unique(yylhs.location); } #line 2036 "parser.cpp" break; case 4: // program: program inline -#line 265 "parser.ypp" +#line 269 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } #line 2042 "parser.cpp" break; case 5: // program: program include -#line 267 "parser.ypp" +#line 271 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2048 "parser.cpp" break; case 6: // program: program declaration -#line 269 "parser.ypp" +#line 273 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2054 "parser.cpp" break; case 7: // program: inline -#line 271 "parser.ypp" +#line 275 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } #line 2060 "parser.cpp" break; case 8: // program: include -#line 273 "parser.ypp" +#line 277 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2066 "parser.cpp" break; case 9: // program: declaration -#line 275 "parser.ypp" +#line 279 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2072 "parser.cpp" break; case 10: // inline: "#inline" expr_path ";" -#line 279 "parser.ypp" +#line 283 "parser.ypp" { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } #line 2078 "parser.cpp" break; case 11: // include: "#include" expr_path ";" -#line 284 "parser.ypp" +#line 288 "parser.ypp" { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } #line 2084 "parser.cpp" break; case 12: // declaration: "/#" -#line 288 "parser.ypp" +#line 292 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } #line 2090 "parser.cpp" break; case 13: // declaration: "#/" -#line 289 "parser.ypp" +#line 293 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } #line 2096 "parser.cpp" break; case 14: // declaration: decl_usingtree -#line 290 "parser.ypp" +#line 294 "parser.ypp" { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } #line 2102 "parser.cpp" break; case 15: // declaration: decl_constant -#line 291 "parser.ypp" +#line 295 "parser.ypp" { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } #line 2108 "parser.cpp" break; case 16: // declaration: decl_thread -#line 292 "parser.ypp" +#line 296 "parser.ypp" { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } #line 2114 "parser.cpp" break; case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 297 "parser.ypp" +#line 301 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_usingtree::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_string::ptr > ())); } #line 2120 "parser.cpp" break; case 18: // decl_constant: expr_identifier "=" expr ";" -#line 302 "parser.ypp" +#line 306 "parser.ypp" { yylhs.value.as < ast::decl_constant::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 2126 "parser.cpp" break; case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 307 "parser.ypp" +#line 311 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2132 "parser.cpp" break; case 20: // stmt: stmt_block -#line 311 "parser.ypp" +#line 315 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } #line 2138 "parser.cpp" break; case 21: // stmt: stmt_call -#line 312 "parser.ypp" +#line 316 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } #line 2144 "parser.cpp" break; case 22: // stmt: stmt_assign -#line 313 "parser.ypp" +#line 317 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } #line 2150 "parser.cpp" break; case 23: // stmt: stmt_endon -#line 314 "parser.ypp" +#line 318 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } #line 2156 "parser.cpp" break; case 24: // stmt: stmt_notify -#line 315 "parser.ypp" +#line 319 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } #line 2162 "parser.cpp" break; case 25: // stmt: stmt_wait -#line 316 "parser.ypp" +#line 320 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } #line 2168 "parser.cpp" break; case 26: // stmt: stmt_waittill -#line 317 "parser.ypp" +#line 321 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } #line 2174 "parser.cpp" break; case 27: // stmt: stmt_waittillmatch -#line 318 "parser.ypp" +#line 322 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } #line 2180 "parser.cpp" break; case 28: // stmt: stmt_waittillframeend -#line 319 "parser.ypp" +#line 323 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } #line 2186 "parser.cpp" break; case 29: // stmt: stmt_waitframe -#line 320 "parser.ypp" +#line 324 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waitframe = std::move(yystack_[0].value.as < ast::stmt_waitframe::ptr > ()); } #line 2192 "parser.cpp" break; case 30: // stmt: stmt_if -#line 321 "parser.ypp" +#line 325 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } #line 2198 "parser.cpp" break; case 31: // stmt: stmt_ifelse -#line 322 "parser.ypp" +#line 326 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } #line 2204 "parser.cpp" break; case 32: // stmt: stmt_while -#line 323 "parser.ypp" +#line 327 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } #line 2210 "parser.cpp" break; case 33: // stmt: stmt_dowhile -#line 324 "parser.ypp" +#line 328 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } #line 2216 "parser.cpp" break; case 34: // stmt: stmt_for -#line 325 "parser.ypp" +#line 329 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } #line 2222 "parser.cpp" break; case 35: // stmt: stmt_foreach -#line 326 "parser.ypp" +#line 330 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } #line 2228 "parser.cpp" break; case 36: // stmt: stmt_switch -#line 327 "parser.ypp" +#line 331 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } #line 2234 "parser.cpp" break; case 37: // stmt: stmt_case -#line 328 "parser.ypp" +#line 332 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } #line 2240 "parser.cpp" break; case 38: // stmt: stmt_default -#line 329 "parser.ypp" +#line 333 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } #line 2246 "parser.cpp" break; case 39: // stmt: stmt_break -#line 330 "parser.ypp" +#line 334 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } #line 2252 "parser.cpp" break; case 40: // stmt: stmt_continue -#line 331 "parser.ypp" +#line 335 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } #line 2258 "parser.cpp" break; case 41: // stmt: stmt_return -#line 332 "parser.ypp" +#line 336 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } #line 2264 "parser.cpp" break; case 42: // stmt: stmt_breakpoint -#line 333 "parser.ypp" +#line 337 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } #line 2270 "parser.cpp" break; case 43: // stmt: stmt_prof_begin -#line 334 "parser.ypp" +#line 338 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } #line 2276 "parser.cpp" break; case 44: // stmt: stmt_prof_end -#line 335 "parser.ypp" +#line 339 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } #line 2282 "parser.cpp" break; case 45: // stmt_or_dev: stmt -#line 339 "parser.ypp" +#line 343 "parser.ypp" { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } #line 2288 "parser.cpp" break; case 46: // stmt_or_dev: stmt_dev -#line 340 "parser.ypp" +#line 344 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } #line 2294 "parser.cpp" break; case 47: // stmt_list: stmt_list stmt -#line 345 "parser.ypp" +#line 349 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2300 "parser.cpp" break; case 48: // stmt_list: stmt -#line 347 "parser.ypp" +#line 351 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2306 "parser.cpp" break; case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 352 "parser.ypp" +#line 356 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2312 "parser.cpp" break; case 50: // stmt_or_dev_list: stmt_or_dev -#line 354 "parser.ypp" +#line 358 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2318 "parser.cpp" break; case 51: // stmt_dev: "/#" stmt_list "#/" -#line 358 "parser.ypp" +#line 362 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::stmt_list::ptr > ())); } #line 2324 "parser.cpp" break; case 52: // stmt_dev: "/#" "#/" -#line 359 "parser.ypp" +#line 363 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2330 "parser.cpp" break; case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 363 "parser.ypp" +#line 367 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } #line 2336 "parser.cpp" break; case 54: // stmt_block: "{" "}" -#line 364 "parser.ypp" +#line 368 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } #line 2342 "parser.cpp" break; case 55: // stmt_expr: expr_assign -#line 369 "parser.ypp" +#line 373 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2348 "parser.cpp" break; case 56: // stmt_expr: expr_increment -#line 371 "parser.ypp" +#line 375 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2354 "parser.cpp" break; case 57: // stmt_expr: expr_decrement -#line 373 "parser.ypp" +#line 377 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2360 "parser.cpp" break; case 58: // stmt_expr: %empty -#line 375 "parser.ypp" +#line 379 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2366 "parser.cpp" break; case 59: // stmt_call: expr_call ";" -#line 380 "parser.ypp" +#line 384 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_call::ptr > ()))); } #line 2372 "parser.cpp" break; case 60: // stmt_call: expr_method ";" -#line 382 "parser.ypp" +#line 386 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_method::ptr > ()))); } #line 2378 "parser.cpp" break; case 61: // stmt_assign: expr_assign ";" -#line 387 "parser.ypp" +#line 391 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2384 "parser.cpp" break; case 62: // stmt_assign: expr_increment ";" -#line 389 "parser.ypp" +#line 393 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2390 "parser.cpp" break; case 63: // stmt_assign: expr_decrement ";" -#line 391 "parser.ypp" +#line 395 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2396 "parser.cpp" break; case 64: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 396 "parser.ypp" +#line 400 "parser.ypp" { yylhs.value.as < ast::stmt_endon::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ())); } #line 2402 "parser.cpp" break; case 65: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 401 "parser.ypp" +#line 405 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2408 "parser.cpp" break; case 66: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 403 "parser.ypp" +#line 407 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2414 "parser.cpp" break; case 67: // stmt_wait: "wait" expr ";" -#line 408 "parser.ypp" +#line 412 "parser.ypp" { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2420 "parser.cpp" break; case 68: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 413 "parser.ypp" +#line 417 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2426 "parser.cpp" break; case 69: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 415 "parser.ypp" +#line 419 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2432 "parser.cpp" break; case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 420 "parser.ypp" +#line 424 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2438 "parser.cpp" break; case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 422 "parser.ypp" +#line 426 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2444 "parser.cpp" break; case 72: // stmt_waittillframeend: "waittillframeend" ";" -#line 427 "parser.ypp" +#line 431 "parser.ypp" { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } #line 2450 "parser.cpp" break; case 73: // stmt_waitframe: "waitframe" ";" -#line 432 "parser.ypp" +#line 436 "parser.ypp" { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } #line 2456 "parser.cpp" break; case 74: // stmt_waitframe: "waitframe" "(" ")" ";" -#line 434 "parser.ypp" +#line 438 "parser.ypp" { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } #line 2462 "parser.cpp" break; case 75: // stmt_if: "if" "(" expr ")" stmt -#line 439 "parser.ypp" +#line 443 "parser.ypp" { yylhs.value.as < ast::stmt_if::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2468 "parser.cpp" break; case 76: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 444 "parser.ypp" +#line 448 "parser.ypp" { yylhs.value.as < ast::stmt_ifelse::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::stmt > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2474 "parser.cpp" break; case 77: // stmt_while: "while" "(" expr ")" stmt -#line 449 "parser.ypp" +#line 453 "parser.ypp" { yylhs.value.as < ast::stmt_while::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2480 "parser.cpp" break; case 78: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 454 "parser.ypp" +#line 458 "parser.ypp" { yylhs.value.as < ast::stmt_dowhile::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[5].value.as < ast::stmt > ())); } #line 2486 "parser.cpp" break; case 79: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 459 "parser.ypp" +#line 463 "parser.ypp" { yylhs.value.as < ast::stmt_for::ptr > () = std::make_unique(yylhs.location, ast::stmt(std::move(yystack_[6].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[4].value.as < ast::expr > ()), ast::stmt(std::move(yystack_[2].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2492 "parser.cpp" break; case 80: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 464 "parser.ypp" +#line 468 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2498 "parser.cpp" break; case 81: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 466 "parser.ypp" +#line 470 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[6].value.as < ast::expr_identifier::ptr > ())), ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2504 "parser.cpp" break; case 82: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 471 "parser.ypp" +#line 475 "parser.ypp" { yylhs.value.as < ast::stmt_switch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2510 "parser.cpp" break; case 83: // stmt_case: "case" expr_integer ":" -#line 476 "parser.ypp" +#line 480 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_integer::ptr > ())), std::make_unique(yylhs.location)); } #line 2516 "parser.cpp" break; case 84: // stmt_case: "case" expr_string ":" -#line 478 "parser.ypp" +#line 482 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_string::ptr > ())), std::make_unique(yylhs.location)); } #line 2522 "parser.cpp" break; case 85: // stmt_default: "default" ":" -#line 483 "parser.ypp" +#line 487 "parser.ypp" { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2528 "parser.cpp" break; case 86: // stmt_break: "break" ";" -#line 488 "parser.ypp" +#line 492 "parser.ypp" { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } #line 2534 "parser.cpp" break; case 87: // stmt_continue: "continue" ";" -#line 493 "parser.ypp" +#line 497 "parser.ypp" { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } #line 2540 "parser.cpp" break; case 88: // stmt_return: "return" expr ";" -#line 498 "parser.ypp" +#line 502 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2546 "parser.cpp" break; case 89: // stmt_return: "return" ";" -#line 500 "parser.ypp" +#line 504 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2552 "parser.cpp" break; case 90: // stmt_breakpoint: "breakpoint" ";" -#line 505 "parser.ypp" +#line 509 "parser.ypp" { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } #line 2558 "parser.cpp" break; case 91: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 510 "parser.ypp" +#line 514 "parser.ypp" { yylhs.value.as < ast::stmt_prof_begin::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2564 "parser.cpp" break; case 92: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 515 "parser.ypp" +#line 519 "parser.ypp" { yylhs.value.as < ast::stmt_prof_end::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2570 "parser.cpp" break; case 93: // expr: expr_ternary -#line 519 "parser.ypp" +#line 523 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2576 "parser.cpp" break; case 94: // expr: expr_binary -#line 520 "parser.ypp" +#line 524 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2582 "parser.cpp" break; case 95: // expr: expr_primitive -#line 521 "parser.ypp" +#line 525 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2588 "parser.cpp" break; case 96: // expr_or_empty: expr -#line 525 "parser.ypp" +#line 529 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2594 "parser.cpp" break; case 97: // expr_or_empty: %empty -#line 526 "parser.ypp" +#line 530 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } #line 2600 "parser.cpp" break; case 98: // expr_assign: expr_object "=" expr -#line 531 "parser.ypp" +#line 535 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2606 "parser.cpp" break; case 99: // expr_assign: expr_object "|=" expr -#line 533 "parser.ypp" +#line 537 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2612 "parser.cpp" break; case 100: // expr_assign: expr_object "&=" expr -#line 535 "parser.ypp" +#line 539 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2618 "parser.cpp" break; case 101: // expr_assign: expr_object "^=" expr -#line 537 "parser.ypp" +#line 541 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2624 "parser.cpp" break; case 102: // expr_assign: expr_object "<<=" expr -#line 539 "parser.ypp" +#line 543 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()),std::move( yystack_[0].value.as < ast::expr > ())); } #line 2630 "parser.cpp" break; case 103: // expr_assign: expr_object ">>=" expr -#line 541 "parser.ypp" +#line 545 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2636 "parser.cpp" break; case 104: // expr_assign: expr_object "+=" expr -#line 543 "parser.ypp" +#line 547 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2642 "parser.cpp" break; case 105: // expr_assign: expr_object "-=" expr -#line 545 "parser.ypp" +#line 549 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2648 "parser.cpp" break; case 106: // expr_assign: expr_object "*=" expr -#line 547 "parser.ypp" +#line 551 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2654 "parser.cpp" break; case 107: // expr_assign: expr_object "/=" expr -#line 549 "parser.ypp" +#line 553 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2660 "parser.cpp" break; case 108: // expr_assign: expr_object "%=" expr -#line 551 "parser.ypp" +#line 555 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2666 "parser.cpp" break; case 109: // expr_increment: "++" expr_object -#line 556 "parser.ypp" +#line 560 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2672 "parser.cpp" break; case 110: // expr_increment: expr_object "++" -#line 558 "parser.ypp" +#line 562 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2678 "parser.cpp" break; case 111: // expr_decrement: "--" expr_object -#line 563 "parser.ypp" +#line 567 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2684 "parser.cpp" break; case 112: // expr_decrement: expr_object "--" -#line 565 "parser.ypp" +#line 569 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2690 "parser.cpp" break; case 113: // expr_ternary: expr "?" expr ":" expr -#line 570 "parser.ypp" +#line 574 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2696 "parser.cpp" break; case 114: // expr_binary: expr "||" expr -#line 575 "parser.ypp" +#line 579 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2702 "parser.cpp" break; case 115: // expr_binary: expr "&&" expr -#line 577 "parser.ypp" +#line 581 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2708 "parser.cpp" break; case 116: // expr_binary: expr "==" expr -#line 579 "parser.ypp" +#line 583 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2714 "parser.cpp" break; case 117: // expr_binary: expr "!=" expr -#line 581 "parser.ypp" +#line 585 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2720 "parser.cpp" break; case 118: // expr_binary: expr "<=" expr -#line 583 "parser.ypp" +#line 587 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2726 "parser.cpp" break; case 119: // expr_binary: expr ">=" expr -#line 585 "parser.ypp" +#line 589 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2732 "parser.cpp" break; case 120: // expr_binary: expr "<" expr -#line 587 "parser.ypp" +#line 591 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2738 "parser.cpp" break; case 121: // expr_binary: expr ">" expr -#line 589 "parser.ypp" +#line 593 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2744 "parser.cpp" break; case 122: // expr_binary: expr "|" expr -#line 591 "parser.ypp" +#line 595 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2750 "parser.cpp" break; case 123: // expr_binary: expr "&" expr -#line 593 "parser.ypp" +#line 597 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2756 "parser.cpp" break; case 124: // expr_binary: expr "^" expr -#line 595 "parser.ypp" +#line 599 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2762 "parser.cpp" break; case 125: // expr_binary: expr "<<" expr -#line 597 "parser.ypp" +#line 601 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2768 "parser.cpp" break; case 126: // expr_binary: expr ">>" expr -#line 599 "parser.ypp" +#line 603 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2774 "parser.cpp" break; case 127: // expr_binary: expr "+" expr -#line 601 "parser.ypp" +#line 605 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2780 "parser.cpp" break; case 128: // expr_binary: expr "-" expr -#line 603 "parser.ypp" +#line 607 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2786 "parser.cpp" break; case 129: // expr_binary: expr "*" expr -#line 605 "parser.ypp" +#line 609 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2792 "parser.cpp" break; case 130: // expr_binary: expr "/" expr -#line 607 "parser.ypp" +#line 611 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2798 "parser.cpp" break; case 131: // expr_binary: expr "%" expr -#line 609 "parser.ypp" +#line 613 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2804 "parser.cpp" break; case 132: // expr_primitive: expr_complement -#line 613 "parser.ypp" +#line 617 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } #line 2810 "parser.cpp" break; case 133: // expr_primitive: expr_not -#line 614 "parser.ypp" +#line 618 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } #line 2816 "parser.cpp" break; case 134: // expr_primitive: expr_call -#line 615 "parser.ypp" +#line 619 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 2822 "parser.cpp" break; case 135: // expr_primitive: expr_method -#line 616 "parser.ypp" +#line 620 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 2828 "parser.cpp" break; case 136: // expr_primitive: expr_add_array -#line 617 "parser.ypp" +#line 621 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } #line 2834 "parser.cpp" break; case 137: // expr_primitive: expr_isdefined -#line 618 "parser.ypp" +#line 622 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_isdefined::ptr > ()); } #line 2840 "parser.cpp" break; case 138: // expr_primitive: expr_istrue -#line 619 "parser.ypp" +#line 623 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istrue::ptr > ()); } #line 2846 "parser.cpp" break; case 139: // expr_primitive: expr_reference -#line 620 "parser.ypp" +#line 624 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } #line 2852 "parser.cpp" break; case 140: // expr_primitive: expr_array -#line 621 "parser.ypp" +#line 625 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 2858 "parser.cpp" break; case 141: // expr_primitive: expr_field -#line 622 "parser.ypp" +#line 626 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 2864 "parser.cpp" break; case 142: // expr_primitive: expr_size -#line 623 "parser.ypp" +#line 627 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } #line 2870 "parser.cpp" break; case 143: // expr_primitive: expr_paren -#line 624 "parser.ypp" +#line 628 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } #line 2876 "parser.cpp" break; case 144: // expr_primitive: expr_thisthread -#line 625 "parser.ypp" +#line 629 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } #line 2882 "parser.cpp" break; case 145: // expr_primitive: expr_empty_array -#line 626 "parser.ypp" +#line 630 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } #line 2888 "parser.cpp" break; case 146: // expr_primitive: expr_undefined -#line 627 "parser.ypp" +#line 631 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } #line 2894 "parser.cpp" break; case 147: // expr_primitive: expr_game -#line 628 "parser.ypp" +#line 632 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 2900 "parser.cpp" break; case 148: // expr_primitive: expr_self -#line 629 "parser.ypp" +#line 633 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 2906 "parser.cpp" break; case 149: // expr_primitive: expr_anim -#line 630 "parser.ypp" +#line 634 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 2912 "parser.cpp" break; case 150: // expr_primitive: expr_level -#line 631 "parser.ypp" +#line 635 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 2918 "parser.cpp" break; case 151: // expr_primitive: expr_animation -#line 632 "parser.ypp" +#line 636 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } #line 2924 "parser.cpp" break; case 152: // expr_primitive: expr_animtree -#line 633 "parser.ypp" +#line 637 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } #line 2930 "parser.cpp" break; case 153: // expr_primitive: expr_identifier -#line 634 "parser.ypp" +#line 638 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 2936 "parser.cpp" break; case 154: // expr_primitive: expr_istring -#line 635 "parser.ypp" +#line 639 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } #line 2942 "parser.cpp" break; case 155: // expr_primitive: expr_string -#line 636 "parser.ypp" +#line 640 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } #line 2948 "parser.cpp" break; case 156: // expr_primitive: expr_vector -#line 637 "parser.ypp" +#line 641 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } #line 2954 "parser.cpp" break; case 157: // expr_primitive: expr_float -#line 638 "parser.ypp" +#line 642 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } #line 2960 "parser.cpp" break; case 158: // expr_primitive: expr_integer -#line 639 "parser.ypp" +#line 643 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } #line 2966 "parser.cpp" break; case 159: // expr_primitive: expr_false -#line 640 "parser.ypp" +#line 644 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } #line 2972 "parser.cpp" break; case 160: // expr_primitive: expr_true -#line 641 "parser.ypp" +#line 645 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } #line 2978 "parser.cpp" break; case 161: // expr_complement: "~" expr -#line 646 "parser.ypp" +#line 650 "parser.ypp" { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2984 "parser.cpp" break; case 162: // expr_not: "!" expr -#line 651 "parser.ypp" +#line 655 "parser.ypp" { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2990 "parser.cpp" break; case 163: // expr_call: expr_function -#line 655 "parser.ypp" +#line 659 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2996 "parser.cpp" break; case 164: // expr_call: expr_pointer -#line 656 "parser.ypp" +#line 660 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 3002 "parser.cpp" break; case 165: // expr_method: expr_object expr_function -#line 659 "parser.ypp" +#line 663 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 3008 "parser.cpp" break; case 166: // expr_method: expr_object expr_pointer -#line 660 "parser.ypp" +#line 664 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 3014 "parser.cpp" break; case 167: // expr_function: expr_identifier "(" expr_arguments ")" -#line 665 "parser.ypp" +#line 669 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3020 "parser.cpp" break; case 168: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 667 "parser.ypp" +#line 671 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3026 "parser.cpp" break; case 169: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 669 "parser.ypp" +#line 673 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3032 "parser.cpp" break; case 170: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 671 "parser.ypp" +#line 675 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3038 "parser.cpp" break; case 171: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 673 "parser.ypp" +#line 677 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 3044 "parser.cpp" break; case 172: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 675 "parser.ypp" +#line 679 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 3050 "parser.cpp" break; case 173: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 680 "parser.ypp" +#line 684 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3056 "parser.cpp" break; case 174: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 682 "parser.ypp" +#line 686 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3062 "parser.cpp" break; case 175: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 684 "parser.ypp" +#line 688 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 3068 "parser.cpp" break; case 176: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 686 "parser.ypp" +#line 690 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::builtin); } #line 3074 "parser.cpp" break; case 177: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 691 "parser.ypp" +#line 695 "parser.ypp" { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } #line 3080 "parser.cpp" break; case 178: // expr_parameters: expr_parameters "," expr_identifier -#line 696 "parser.ypp" +#line 700 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3086 "parser.cpp" break; case 179: // expr_parameters: expr_identifier -#line 698 "parser.ypp" +#line 702 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3092 "parser.cpp" break; case 180: // expr_parameters: %empty -#line 700 "parser.ypp" +#line 704 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } #line 3098 "parser.cpp" break; case 181: // expr_arguments: expr_arguments_no_empty -#line 705 "parser.ypp" +#line 709 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } #line 3104 "parser.cpp" break; case 182: // expr_arguments: %empty -#line 707 "parser.ypp" +#line 711 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } #line 3110 "parser.cpp" break; case 183: // expr_arguments_no_empty: expr_arguments "," expr -#line 712 "parser.ypp" +#line 716 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ()); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3116 "parser.cpp" break; case 184: // expr_arguments_no_empty: expr -#line 714 "parser.ypp" +#line 718 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3122 "parser.cpp" break; case 185: // expr_isdefined: "isdefined" "(" expr ")" -#line 719 "parser.ypp" +#line 723 "parser.ypp" { yylhs.value.as < ast::expr_isdefined::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3128 "parser.cpp" break; case 186: // expr_istrue: "istrue" "(" expr ")" -#line 724 "parser.ypp" +#line 728 "parser.ypp" { yylhs.value.as < ast::expr_istrue::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3134 "parser.cpp" break; case 187: // expr_reference: "::" expr_identifier -#line 729 "parser.ypp" +#line 733 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3140 "parser.cpp" break; case 188: // expr_reference: expr_path "::" expr_identifier -#line 731 "parser.ypp" +#line 735 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_path::ptr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3146 "parser.cpp" break; case 189: // expr_array: expr_object "[" expr "]" -#line 736 "parser.ypp" +#line 740 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3152 "parser.cpp" break; case 190: // expr_field: expr_object "." expr_identifier_nosize -#line 741 "parser.ypp" +#line 745 "parser.ypp" { yylhs.value.as < ast::expr_field::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3158 "parser.cpp" break; case 191: // expr_size: expr_object "." "size" -#line 746 "parser.ypp" +#line 750 "parser.ypp" { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } #line 3164 "parser.cpp" break; case 192: // expr_paren: "(" expr ")" -#line 751 "parser.ypp" +#line 755 "parser.ypp" { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3170 "parser.cpp" break; case 193: // expr_object: expr_call -#line 755 "parser.ypp" +#line 759 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 3176 "parser.cpp" break; case 194: // expr_object: expr_method -#line 756 "parser.ypp" +#line 760 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 3182 "parser.cpp" break; case 195: // expr_object: expr_array -#line 757 "parser.ypp" +#line 761 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 3188 "parser.cpp" break; case 196: // expr_object: expr_field -#line 758 "parser.ypp" +#line 762 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 3194 "parser.cpp" break; case 197: // expr_object: expr_game -#line 759 "parser.ypp" +#line 763 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 3200 "parser.cpp" break; case 198: // expr_object: expr_self -#line 760 "parser.ypp" +#line 764 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 3206 "parser.cpp" break; case 199: // expr_object: expr_anim -#line 761 "parser.ypp" +#line 765 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 3212 "parser.cpp" break; case 200: // expr_object: expr_level -#line 762 "parser.ypp" +#line 766 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 3218 "parser.cpp" break; case 201: // expr_object: expr_identifier -#line 763 "parser.ypp" +#line 767 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 3224 "parser.cpp" break; case 202: // expr_thisthread: "thisthread" -#line 768 "parser.ypp" +#line 772 "parser.ypp" { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } #line 3230 "parser.cpp" break; case 203: // expr_empty_array: "[" "]" -#line 773 "parser.ypp" +#line 777 "parser.ypp" { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } #line 3236 "parser.cpp" break; case 204: // expr_undefined: "undefined" -#line 778 "parser.ypp" +#line 782 "parser.ypp" { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } #line 3242 "parser.cpp" break; case 205: // expr_game: "game" -#line 783 "parser.ypp" +#line 787 "parser.ypp" { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } #line 3248 "parser.cpp" break; case 206: // expr_self: "self" -#line 788 "parser.ypp" +#line 792 "parser.ypp" { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } #line 3254 "parser.cpp" break; case 207: // expr_anim: "anim" -#line 793 "parser.ypp" +#line 797 "parser.ypp" { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } #line 3260 "parser.cpp" break; case 208: // expr_level: "level" -#line 798 "parser.ypp" +#line 802 "parser.ypp" { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } #line 3266 "parser.cpp" break; case 209: // expr_animation: "%" "identifier" -#line 803 "parser.ypp" +#line 807 "parser.ypp" { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3272 "parser.cpp" break; case 210: // expr_animtree: "#animtree" -#line 808 "parser.ypp" +#line 812 "parser.ypp" { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } #line 3278 "parser.cpp" break; case 211: // expr_identifier_nosize: "identifier" -#line 813 "parser.ypp" +#line 817 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3284 "parser.cpp" break; case 212: // expr_identifier: "identifier" -#line 818 "parser.ypp" +#line 822 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3290 "parser.cpp" break; case 213: // expr_identifier: "size" -#line 820 "parser.ypp" +#line 824 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } #line 3296 "parser.cpp" break; case 214: // expr_path: "identifier" -#line 825 "parser.ypp" +#line 829 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3302 "parser.cpp" break; case 215: // expr_path: "path" -#line 827 "parser.ypp" +#line 831 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3308 "parser.cpp" break; case 216: // expr_istring: "localized string" -#line 832 "parser.ypp" +#line 836 "parser.ypp" { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3314 "parser.cpp" break; case 217: // expr_string: "string literal" -#line 837 "parser.ypp" +#line 841 "parser.ypp" { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3320 "parser.cpp" break; case 218: // expr_vector: "(" expr "," expr "," expr ")" -#line 842 "parser.ypp" +#line 846 "parser.ypp" { yylhs.value.as < ast::expr_vector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3326 "parser.cpp" break; case 219: // expr_float: "-" "float" -#line 847 "parser.ypp" +#line 851 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3332 "parser.cpp" break; case 220: // expr_float: "float" -#line 849 "parser.ypp" +#line 853 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3338 "parser.cpp" break; case 221: // expr_integer: "-" "integer" -#line 854 "parser.ypp" +#line 858 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3344 "parser.cpp" break; case 222: // expr_integer: "integer" -#line 856 "parser.ypp" +#line 860 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3350 "parser.cpp" break; case 223: // expr_false: "false" -#line 861 "parser.ypp" +#line 865 "parser.ypp" { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } #line 3356 "parser.cpp" break; case 224: // expr_true: "true" -#line 866 "parser.ypp" +#line 870 "parser.ypp" { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } #line 3362 "parser.cpp" break; @@ -3627,6 +3627,8 @@ namespace xsk { namespace gsc { namespace iw8 { } + + bool parser::yy_lac_check_ (symbol_kind_type yytoken) const { @@ -3731,7 +3733,9 @@ namespace xsk { namespace gsc { namespace iw8 { follows. If no initial context is currently established for the current lookahead, then check if that lookahead can eventually be shifted if syntactic actions continue from the current context. */ - if (!yy_lac_established_) + if (yy_lac_established_) + return true; + else { #if IW8DEBUG YYCDEBUG << "LAC: initial context established for " @@ -3740,12 +3744,11 @@ namespace xsk { namespace gsc { namespace iw8 { yy_lac_established_ = true; return yy_lac_check_ (yytoken); } - return true; } // Discard any previous initial lookahead context. void - parser::yy_lac_discard_ (const char* evt) + parser::yy_lac_discard_ (const char* event) { /* Discard any previous initial lookahead context because of Event, which may be a lookahead change or an invalidation of the currently @@ -3761,11 +3764,12 @@ namespace xsk { namespace gsc { namespace iw8 { if (yy_lac_established_) { YYCDEBUG << "LAC: initial context discarded due to " - << evt << '\n'; + << event << '\n'; yy_lac_established_ = false; } } + int parser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -4559,29 +4563,29 @@ namespace xsk { namespace gsc { namespace iw8 { const short parser::yyrline_[] = { - 0, 259, 259, 260, 264, 266, 268, 270, 272, 274, - 279, 283, 288, 289, 290, 291, 292, 296, 301, 306, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 339, 340, 344, 346, 351, - 353, 358, 359, 363, 364, 368, 370, 372, 375, 379, - 381, 386, 388, 390, 395, 400, 402, 407, 412, 414, - 419, 421, 426, 431, 433, 438, 443, 448, 453, 458, - 463, 465, 470, 475, 477, 482, 487, 492, 497, 499, - 504, 509, 514, 519, 520, 521, 525, 526, 530, 532, - 534, 536, 538, 540, 542, 544, 546, 548, 550, 555, - 557, 562, 564, 569, 574, 576, 578, 580, 582, 584, - 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, - 606, 608, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 645, 650, 655, 656, 659, 660, 664, 666, 668, - 670, 672, 674, 679, 681, 683, 685, 690, 695, 697, - 700, 704, 707, 711, 713, 718, 723, 728, 730, 735, - 740, 745, 750, 755, 756, 757, 758, 759, 760, 761, - 762, 763, 767, 772, 777, 782, 787, 792, 797, 802, - 807, 812, 817, 819, 824, 826, 831, 836, 841, 846, - 848, 853, 855, 860, 865 + 0, 263, 263, 264, 268, 270, 272, 274, 276, 278, + 283, 287, 292, 293, 294, 295, 296, 300, 305, 310, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 343, 344, 348, 350, 355, + 357, 362, 363, 367, 368, 372, 374, 376, 379, 383, + 385, 390, 392, 394, 399, 404, 406, 411, 416, 418, + 423, 425, 430, 435, 437, 442, 447, 452, 457, 462, + 467, 469, 474, 479, 481, 486, 491, 496, 501, 503, + 508, 513, 518, 523, 524, 525, 529, 530, 534, 536, + 538, 540, 542, 544, 546, 548, 550, 552, 554, 559, + 561, 566, 568, 573, 578, 580, 582, 584, 586, 588, + 590, 592, 594, 596, 598, 600, 602, 604, 606, 608, + 610, 612, 617, 618, 619, 620, 621, 622, 623, 624, + 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, + 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 649, 654, 659, 660, 663, 664, 668, 670, 672, + 674, 676, 678, 683, 685, 687, 689, 694, 699, 701, + 704, 708, 711, 715, 717, 722, 727, 732, 734, 739, + 744, 749, 754, 759, 760, 761, 762, 763, 764, 765, + 766, 767, 771, 776, 781, 786, 791, 796, 801, 806, + 811, 816, 821, 823, 828, 830, 835, 840, 845, 850, + 852, 857, 859, 864, 869 }; void @@ -4614,9 +4618,9 @@ namespace xsk { namespace gsc { namespace iw8 { #line 13 "parser.ypp" } } } // xsk::gsc::iw8 -#line 4618 "parser.cpp" +#line 4622 "parser.cpp" -#line 869 "parser.ypp" +#line 873 "parser.ypp" void xsk::gsc::iw8::parser::error(const xsk::gsc::location& loc, const std::string& msg) diff --git a/src/iw8/xsk/parser.hpp b/src/iw8/xsk/parser.hpp index 440f60a8..7dd50883 100644 --- a/src/iw8/xsk/parser.hpp +++ b/src/iw8/xsk/parser.hpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -47,10 +47,14 @@ // "%code requires" blocks. #line 28 "parser.ypp" +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "iw8.hpp" namespace xsk::gsc::iw8 { class lexer; } -#line 54 "parser.hpp" +#line 58 "parser.hpp" # include # include // std::abort @@ -126,12 +130,18 @@ namespace xsk::gsc::iw8 { class lexer; } # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -193,7 +203,7 @@ namespace xsk::gsc::iw8 { class lexer; } #line 13 "parser.ypp" namespace xsk { namespace gsc { namespace iw8 { -#line 197 "parser.hpp" +#line 207 "parser.hpp" @@ -202,27 +212,32 @@ namespace xsk { namespace gsc { namespace iw8 { class parser { public: -#ifndef IW8STYPE +#ifdef IW8STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define IW8STYPE in C++, use %define api.value.type" +# endif + typedef IW8STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { IW8_ASSERT (sizeof (T) <= size); @@ -231,13 +246,13 @@ namespace xsk { namespace gsc { namespace iw8 { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { IW8_ASSERT (!yytypeid_); } @@ -381,7 +396,7 @@ namespace xsk { namespace gsc { namespace iw8 { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -391,7 +406,7 @@ namespace xsk { namespace gsc { namespace iw8 { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -400,7 +415,7 @@ namespace xsk { namespace gsc { namespace iw8 { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -641,18 +656,19 @@ namespace xsk { namespace gsc { namespace iw8 { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef IW8STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef xsk::gsc::location location_type; @@ -801,7 +817,7 @@ namespace xsk { namespace gsc { namespace iw8 { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -1035,7 +1051,7 @@ namespace xsk { namespace gsc { namespace iw8 { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -2339,6 +2355,8 @@ namespace xsk { namespace gsc { namespace iw8 { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -2673,7 +2691,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -2688,22 +2706,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { - /// Default constructor. - by_kind (); - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that); -#endif - - /// Copy constructor. - by_kind (const by_kind& that); - /// The symbol kind as needed by the constructor. typedef token_kind_type kind_type; + /// Default constructor. + by_kind () YY_NOEXCEPT; + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that) YY_NOEXCEPT; +#endif + + /// Copy constructor. + by_kind (const by_kind& that) YY_NOEXCEPT; + /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -2733,30 +2753,34 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ IW8_ASSERT (tok == token::IW8EOF || (token::IW8error <= tok && tok <= token::MOD) || (token::SIZEOF <= tok && tok <= token::POSTDEC)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ IW8_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); +#endif } }; @@ -2805,7 +2829,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static const char *symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -4587,19 +4611,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const short yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; @@ -4626,14 +4650,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const unsigned char yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const unsigned char yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -4732,7 +4756,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -4811,7 +4835,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -4870,7 +4894,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -4889,7 +4913,7 @@ switch (yykind) inline parser::symbol_kind_type - parser::yytranslate_ (int t) + parser::yytranslate_ (int t) YY_NOEXCEPT { return static_cast (t); } @@ -5206,6 +5230,7 @@ switch (yykind) + template parser::symbol_kind_type parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -5213,6 +5238,7 @@ switch (yykind) return this->kind (); } + template bool parser::basic_symbol::empty () const YY_NOEXCEPT @@ -5531,13 +5557,13 @@ switch (yykind) // by_kind. inline - parser::by_kind::by_kind () + parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - parser::by_kind::by_kind (by_kind&& that) + parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -5545,15 +5571,17 @@ switch (yykind) #endif inline - parser::by_kind::by_kind (const by_kind& that) + parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - parser::by_kind::by_kind (token_kind_type t) + parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void parser::by_kind::clear () YY_NOEXCEPT @@ -5576,6 +5604,7 @@ switch (yykind) return kind_; } + inline parser::symbol_kind_type parser::by_kind::type_get () const YY_NOEXCEPT @@ -5583,9 +5612,10 @@ switch (yykind) return this->kind (); } + #line 13 "parser.ypp" } } } // xsk::gsc::iw8 -#line 5589 "parser.hpp" +#line 5619 "parser.hpp" diff --git a/src/iw8/xsk/resolver.cpp b/src/iw8/xsk/resolver.cpp index 33be4551..250764de 100644 --- a/src/iw8/xsk/resolver.cpp +++ b/src/iw8/xsk/resolver.cpp @@ -6,6 +6,11 @@ #include "stdafx.hpp" #include "iw8.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4244) +#endif + namespace xsk::gsc::iw8 { @@ -61,7 +66,7 @@ auto resolver::function_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_func_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = function_map_rev.find(name); @@ -90,7 +95,7 @@ auto resolver::method_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_meth_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = method_map_rev.find(name); @@ -119,7 +124,7 @@ auto resolver::file_id(const std::string& name) -> std::uint32_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = file_map_rev.find(name); @@ -148,7 +153,7 @@ auto resolver::token_id(const std::string& name) -> std::uint32_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = token_map_rev.find(name); @@ -212,7 +217,7 @@ auto resolver::make_token(std::string_view str) -> std::string for (std::size_t i = 0; i < data.size(); i++) { - data[i] = std::tolower(str[i]); + data[i] = static_cast(std::tolower(static_cast(str[i]))); if (data[i] == '\\') data[i] = '/'; } @@ -75643,3 +75648,7 @@ struct __init__ __init__ _; } // namespace xsk::gsc::iw8 + +#ifdef _MSC_VER +#pragma warning(pop) +#endif diff --git a/src/s1/stdafx.hpp b/src/s1/stdafx.hpp index 0870d77e..19f22f43 100644 --- a/src/s1/stdafx.hpp +++ b/src/s1/stdafx.hpp @@ -5,38 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4005) -#pragma warning(disable:4018) -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4389) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include -// Ext using namespace std::literals; - -#include "xsk/s1.hpp" diff --git a/src/s1/xsk/assembler.cpp b/src/s1/xsk/assembler.cpp index e0b83c48..adb2562f 100644 --- a/src/s1/xsk/assembler.cpp +++ b/src/s1/xsk/assembler.cpp @@ -143,7 +143,7 @@ void assembler::assemble_function(const function::ptr& func) func->id = resolver::token_id(func->name); stack_->write(func->size); - stack_->write(func->id); + stack_->write(static_cast(func->id)); if (func->id == 0) { @@ -453,7 +453,7 @@ void assembler::assemble_end_switch(const instruction::ptr& inst) const auto count = std::stoul(inst->data[0]); - script_->write(count); + script_->write(static_cast(count)); std::uint32_t index = inst->index + 3; @@ -520,15 +520,15 @@ void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back if (expr) { - script_->write(addr - inst->index - 3); + script_->write(static_cast(addr - inst->index - 3)); } else if (back) { - script_->write((inst->index + 3) - addr); + script_->write(static_cast((inst->index + 3) - addr)); } else { - script_->write(addr - inst->index - 5); + script_->write(static_cast(addr - inst->index - 5)); } } @@ -547,11 +547,11 @@ void assembler::assemble_offset(std::int32_t offset) auto assembler::resolve_function(const std::string& name) -> std::int32_t { - for (const auto& func : functions_) + for (const auto& entry : functions_) { - if (func->name == name) + if (entry->name == name) { - return func->index; + return entry->index; } } @@ -560,11 +560,11 @@ auto assembler::resolve_function(const std::string& name) -> std::int32_t auto assembler::resolve_label(const std::string& name) -> std::int32_t { - for (const auto& func : labels_) + for (const auto& entry : labels_) { - if (func.second == name) + if (entry.second == name) { - return func.first; + return entry.first; } } diff --git a/src/s1/xsk/compiler.cpp b/src/s1/xsk/compiler.cpp index 6e154ebd..e1d381c7 100644 --- a/src/s1/xsk/compiler.cpp +++ b/src/s1/xsk/compiler.cpp @@ -848,7 +848,7 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: emit_opcode(opcode::OP_endswitch, data); - auto offset = 7 * stmt->stmt->list.size(); + auto offset = static_cast(7 * stmt->stmt->list.size()); function_->instructions.back()->size += offset; index_ += offset; @@ -2669,7 +2669,7 @@ auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const { if (blk->local_vars.at(i).init) { - return blk->local_vars_create_count - 1 - i; + return static_cast(blk->local_vars_create_count - 1 - i); } throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); diff --git a/src/s1/xsk/decompiler.cpp b/src/s1/xsk/decompiler.cpp index 07fc90d8..e246edcc 100644 --- a/src/s1/xsk/decompiler.cpp +++ b/src/s1/xsk/decompiler.cpp @@ -1787,7 +1787,7 @@ void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) void decompiler::decompile_infinites(const ast::stmt_list::ptr& stmt) { - for (int i = stmt->list.size() - 1; i >= 0; i--) + for (auto i = stmt->list.size() - 1; i > 0; i--) { if (stmt->list.at(i) == ast::kind::asm_jump_back) { @@ -1950,7 +1950,7 @@ void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) } } -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_end = stmt->list.at(begin).as_cond->value; @@ -1978,7 +1978,7 @@ void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t beg stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.loc_end = stmt->list.at(end).loc().label(); @@ -2029,7 +2029,7 @@ void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.is_last = true; @@ -2089,7 +2089,7 @@ void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uin } } -void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); @@ -2119,7 +2119,7 @@ void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32 stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t start, std::uint32_t end) +void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::size_t start, std::size_t end) { auto& last = block->list.at(end - 1); @@ -2184,7 +2184,7 @@ void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t decompile_while(block, start, end); } -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2214,7 +2214,7 @@ void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2245,7 +2245,7 @@ void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2299,7 +2299,7 @@ void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t be stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2366,7 +2366,7 @@ void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t start) +void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) { block blk; blk.loc_continue = blocks_.back().loc_continue; @@ -2479,7 +2479,7 @@ void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); } -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool +auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool { for (auto i = begin; i < end; i++) { @@ -2498,7 +2498,7 @@ auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::u return false; } -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t +auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t { auto index = 0u; @@ -2516,7 +2516,7 @@ auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std: throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); } -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool +auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool { if (index == stmt->list.size() - 1) return true; @@ -3334,7 +3334,7 @@ void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) { - blk->local_vars_public_count = blk->local_vars.size() - std::stoi(expr->index); + blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); } } // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/decompiler.hpp b/src/s1/xsk/decompiler.hpp index af8a3287..7662e7b1 100644 --- a/src/s1/xsk/decompiler.hpp +++ b/src/s1/xsk/decompiler.hpp @@ -34,19 +34,19 @@ private: void decompile_switches(const ast::stmt_list::ptr& stmt); void decompile_ifelses(const ast::stmt_list::ptr& stmt); void decompile_aborts(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool; + void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); + auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; + auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; + auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; void process_stack(const ast::decl_thread::ptr& thread); void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); void process_stmt(const ast::stmt& stmt, const block::ptr& blk); diff --git a/src/s1/xsk/disassembler.cpp b/src/s1/xsk/disassembler.cpp index 493020e1..521fbcc4 100644 --- a/src/s1/xsk/disassembler.cpp +++ b/src/s1/xsk/disassembler.cpp @@ -51,7 +51,7 @@ void disassembler::disassemble(const std::string& file, std::vectorindex = static_cast(script_->pos()); func->size = stack_->read(); func->id = stack_->read(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id); + func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); dissasemble_function(func); diff --git a/src/s1/xsk/lexer.cpp b/src/s1/xsk/lexer.cpp index e179c005..ce72b4ff 100644 --- a/src/s1/xsk/lexer.cpp +++ b/src/s1/xsk/lexer.cpp @@ -97,7 +97,7 @@ void reader::init(const char* data, size_t size) { state = reader::ok; buffer_pos = data; - bytes_remaining = size; + bytes_remaining = static_cast(size); last_byte = 0; current_byte = *data; } diff --git a/src/s1/xsk/parser.cpp b/src/s1/xsk/parser.cpp index 4a88b707..d8c9009b 100644 --- a/src/s1/xsk/parser.cpp +++ b/src/s1/xsk/parser.cpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -35,7 +35,7 @@ // private implementation details that can be changed or removed. // "%code top" blocks. -#line 34 "parser.ypp" +#line 38 "parser.ypp" #include "stdafx.hpp" #include "parser.hpp" @@ -166,9 +166,9 @@ namespace xsk { namespace gsc { namespace s1 { parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -1467,7 +1467,7 @@ namespace xsk { namespace gsc { namespace s1 { } void - parser::yypop_ (int n) + parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -1510,13 +1510,13 @@ namespace xsk { namespace gsc { namespace s1 { } bool - parser::yy_pact_value_is_default_ (int yyvalue) + parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - parser::yy_table_value_is_error_ (int yyvalue) + parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -1547,8 +1547,8 @@ namespace xsk { namespace gsc { namespace s1 { /// The return value of parse (). int yyresult; - /// Discard the LAC context in case there still is one left from a - /// previous invocation. + // Discard the LAC context in case there still is one left from a + // previous invocation. yy_lac_discard_ ("init"); #if YY_EXCEPTIONS @@ -1626,7 +1626,7 @@ namespace xsk { namespace gsc { namespace s1 { if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) { if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; goto yydefault; } @@ -1637,7 +1637,7 @@ namespace xsk { namespace gsc { namespace s1 { if (yy_table_value_is_error_ (yyn)) goto yyerrlab; if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -1984,1315 +1984,1315 @@ namespace xsk { namespace gsc { namespace s1 { switch (yyn) { case 2: // root: program -#line 255 "parser.ypp" +#line 259 "parser.ypp" { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } #line 1990 "parser.cpp" break; case 3: // root: %empty -#line 256 "parser.ypp" +#line 260 "parser.ypp" { ast = std::make_unique(yylhs.location); } #line 1996 "parser.cpp" break; case 4: // program: program inline -#line 261 "parser.ypp" +#line 265 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } #line 2002 "parser.cpp" break; case 5: // program: program include -#line 263 "parser.ypp" +#line 267 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2008 "parser.cpp" break; case 6: // program: program declaration -#line 265 "parser.ypp" +#line 269 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2014 "parser.cpp" break; case 7: // program: inline -#line 267 "parser.ypp" +#line 271 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } #line 2020 "parser.cpp" break; case 8: // program: include -#line 269 "parser.ypp" +#line 273 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2026 "parser.cpp" break; case 9: // program: declaration -#line 271 "parser.ypp" +#line 275 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2032 "parser.cpp" break; case 10: // inline: "#inline" expr_path ";" -#line 275 "parser.ypp" +#line 279 "parser.ypp" { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } #line 2038 "parser.cpp" break; case 11: // include: "#include" expr_path ";" -#line 280 "parser.ypp" +#line 284 "parser.ypp" { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } #line 2044 "parser.cpp" break; case 12: // declaration: "/#" -#line 284 "parser.ypp" +#line 288 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } #line 2050 "parser.cpp" break; case 13: // declaration: "#/" -#line 285 "parser.ypp" +#line 289 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } #line 2056 "parser.cpp" break; case 14: // declaration: decl_usingtree -#line 286 "parser.ypp" +#line 290 "parser.ypp" { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } #line 2062 "parser.cpp" break; case 15: // declaration: decl_constant -#line 287 "parser.ypp" +#line 291 "parser.ypp" { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } #line 2068 "parser.cpp" break; case 16: // declaration: decl_thread -#line 288 "parser.ypp" +#line 292 "parser.ypp" { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } #line 2074 "parser.cpp" break; case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 293 "parser.ypp" +#line 297 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_usingtree::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_string::ptr > ())); } #line 2080 "parser.cpp" break; case 18: // decl_constant: expr_identifier "=" expr ";" -#line 298 "parser.ypp" +#line 302 "parser.ypp" { yylhs.value.as < ast::decl_constant::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 2086 "parser.cpp" break; case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 303 "parser.ypp" +#line 307 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2092 "parser.cpp" break; case 20: // stmt: stmt_block -#line 307 "parser.ypp" +#line 311 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } #line 2098 "parser.cpp" break; case 21: // stmt: stmt_call -#line 308 "parser.ypp" +#line 312 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } #line 2104 "parser.cpp" break; case 22: // stmt: stmt_assign -#line 309 "parser.ypp" +#line 313 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } #line 2110 "parser.cpp" break; case 23: // stmt: stmt_endon -#line 310 "parser.ypp" +#line 314 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } #line 2116 "parser.cpp" break; case 24: // stmt: stmt_notify -#line 311 "parser.ypp" +#line 315 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } #line 2122 "parser.cpp" break; case 25: // stmt: stmt_wait -#line 312 "parser.ypp" +#line 316 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } #line 2128 "parser.cpp" break; case 26: // stmt: stmt_waittill -#line 313 "parser.ypp" +#line 317 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } #line 2134 "parser.cpp" break; case 27: // stmt: stmt_waittillmatch -#line 314 "parser.ypp" +#line 318 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } #line 2140 "parser.cpp" break; case 28: // stmt: stmt_waittillframeend -#line 315 "parser.ypp" +#line 319 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } #line 2146 "parser.cpp" break; case 29: // stmt: stmt_waitframe -#line 316 "parser.ypp" +#line 320 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waitframe = std::move(yystack_[0].value.as < ast::stmt_waitframe::ptr > ()); } #line 2152 "parser.cpp" break; case 30: // stmt: stmt_if -#line 317 "parser.ypp" +#line 321 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } #line 2158 "parser.cpp" break; case 31: // stmt: stmt_ifelse -#line 318 "parser.ypp" +#line 322 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } #line 2164 "parser.cpp" break; case 32: // stmt: stmt_while -#line 319 "parser.ypp" +#line 323 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } #line 2170 "parser.cpp" break; case 33: // stmt: stmt_dowhile -#line 320 "parser.ypp" +#line 324 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } #line 2176 "parser.cpp" break; case 34: // stmt: stmt_for -#line 321 "parser.ypp" +#line 325 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } #line 2182 "parser.cpp" break; case 35: // stmt: stmt_foreach -#line 322 "parser.ypp" +#line 326 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } #line 2188 "parser.cpp" break; case 36: // stmt: stmt_switch -#line 323 "parser.ypp" +#line 327 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } #line 2194 "parser.cpp" break; case 37: // stmt: stmt_case -#line 324 "parser.ypp" +#line 328 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } #line 2200 "parser.cpp" break; case 38: // stmt: stmt_default -#line 325 "parser.ypp" +#line 329 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } #line 2206 "parser.cpp" break; case 39: // stmt: stmt_break -#line 326 "parser.ypp" +#line 330 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } #line 2212 "parser.cpp" break; case 40: // stmt: stmt_continue -#line 327 "parser.ypp" +#line 331 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } #line 2218 "parser.cpp" break; case 41: // stmt: stmt_return -#line 328 "parser.ypp" +#line 332 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } #line 2224 "parser.cpp" break; case 42: // stmt: stmt_breakpoint -#line 329 "parser.ypp" +#line 333 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } #line 2230 "parser.cpp" break; case 43: // stmt: stmt_prof_begin -#line 330 "parser.ypp" +#line 334 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } #line 2236 "parser.cpp" break; case 44: // stmt: stmt_prof_end -#line 331 "parser.ypp" +#line 335 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } #line 2242 "parser.cpp" break; case 45: // stmt_or_dev: stmt -#line 335 "parser.ypp" +#line 339 "parser.ypp" { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } #line 2248 "parser.cpp" break; case 46: // stmt_or_dev: stmt_dev -#line 336 "parser.ypp" +#line 340 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } #line 2254 "parser.cpp" break; case 47: // stmt_list: stmt_list stmt -#line 341 "parser.ypp" +#line 345 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2260 "parser.cpp" break; case 48: // stmt_list: stmt -#line 343 "parser.ypp" +#line 347 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2266 "parser.cpp" break; case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 348 "parser.ypp" +#line 352 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2272 "parser.cpp" break; case 50: // stmt_or_dev_list: stmt_or_dev -#line 350 "parser.ypp" +#line 354 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2278 "parser.cpp" break; case 51: // stmt_dev: "/#" stmt_list "#/" -#line 354 "parser.ypp" +#line 358 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::stmt_list::ptr > ())); } #line 2284 "parser.cpp" break; case 52: // stmt_dev: "/#" "#/" -#line 355 "parser.ypp" +#line 359 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2290 "parser.cpp" break; case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 359 "parser.ypp" +#line 363 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } #line 2296 "parser.cpp" break; case 54: // stmt_block: "{" "}" -#line 360 "parser.ypp" +#line 364 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } #line 2302 "parser.cpp" break; case 55: // stmt_expr: expr_assign -#line 365 "parser.ypp" +#line 369 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2308 "parser.cpp" break; case 56: // stmt_expr: expr_increment -#line 367 "parser.ypp" +#line 371 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2314 "parser.cpp" break; case 57: // stmt_expr: expr_decrement -#line 369 "parser.ypp" +#line 373 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2320 "parser.cpp" break; case 58: // stmt_expr: %empty -#line 371 "parser.ypp" +#line 375 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2326 "parser.cpp" break; case 59: // stmt_call: expr_call ";" -#line 376 "parser.ypp" +#line 380 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_call::ptr > ()))); } #line 2332 "parser.cpp" break; case 60: // stmt_call: expr_method ";" -#line 378 "parser.ypp" +#line 382 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_method::ptr > ()))); } #line 2338 "parser.cpp" break; case 61: // stmt_assign: expr_assign ";" -#line 383 "parser.ypp" +#line 387 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2344 "parser.cpp" break; case 62: // stmt_assign: expr_increment ";" -#line 385 "parser.ypp" +#line 389 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2350 "parser.cpp" break; case 63: // stmt_assign: expr_decrement ";" -#line 387 "parser.ypp" +#line 391 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2356 "parser.cpp" break; case 64: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 392 "parser.ypp" +#line 396 "parser.ypp" { yylhs.value.as < ast::stmt_endon::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ())); } #line 2362 "parser.cpp" break; case 65: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 397 "parser.ypp" +#line 401 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2368 "parser.cpp" break; case 66: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 399 "parser.ypp" +#line 403 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2374 "parser.cpp" break; case 67: // stmt_wait: "wait" expr ";" -#line 404 "parser.ypp" +#line 408 "parser.ypp" { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2380 "parser.cpp" break; case 68: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 409 "parser.ypp" +#line 413 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2386 "parser.cpp" break; case 69: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 411 "parser.ypp" +#line 415 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2392 "parser.cpp" break; case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 416 "parser.ypp" +#line 420 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2398 "parser.cpp" break; case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 418 "parser.ypp" +#line 422 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2404 "parser.cpp" break; case 72: // stmt_waittillframeend: "waittillframeend" ";" -#line 423 "parser.ypp" +#line 427 "parser.ypp" { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } #line 2410 "parser.cpp" break; case 73: // stmt_waitframe: "waitframe" ";" -#line 428 "parser.ypp" +#line 432 "parser.ypp" { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } #line 2416 "parser.cpp" break; case 74: // stmt_waitframe: "waitframe" "(" ")" ";" -#line 430 "parser.ypp" +#line 434 "parser.ypp" { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } #line 2422 "parser.cpp" break; case 75: // stmt_if: "if" "(" expr ")" stmt -#line 435 "parser.ypp" +#line 439 "parser.ypp" { yylhs.value.as < ast::stmt_if::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2428 "parser.cpp" break; case 76: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 440 "parser.ypp" +#line 444 "parser.ypp" { yylhs.value.as < ast::stmt_ifelse::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::stmt > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2434 "parser.cpp" break; case 77: // stmt_while: "while" "(" expr ")" stmt -#line 445 "parser.ypp" +#line 449 "parser.ypp" { yylhs.value.as < ast::stmt_while::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2440 "parser.cpp" break; case 78: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 450 "parser.ypp" +#line 454 "parser.ypp" { yylhs.value.as < ast::stmt_dowhile::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[5].value.as < ast::stmt > ())); } #line 2446 "parser.cpp" break; case 79: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 455 "parser.ypp" +#line 459 "parser.ypp" { yylhs.value.as < ast::stmt_for::ptr > () = std::make_unique(yylhs.location, ast::stmt(std::move(yystack_[6].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[4].value.as < ast::expr > ()), ast::stmt(std::move(yystack_[2].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2452 "parser.cpp" break; case 80: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 460 "parser.ypp" +#line 464 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2458 "parser.cpp" break; case 81: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 462 "parser.ypp" +#line 466 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[6].value.as < ast::expr_identifier::ptr > ())), ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2464 "parser.cpp" break; case 82: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 467 "parser.ypp" +#line 471 "parser.ypp" { yylhs.value.as < ast::stmt_switch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2470 "parser.cpp" break; case 83: // stmt_case: "case" expr_integer ":" -#line 472 "parser.ypp" +#line 476 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_integer::ptr > ())), std::make_unique(yylhs.location)); } #line 2476 "parser.cpp" break; case 84: // stmt_case: "case" expr_string ":" -#line 474 "parser.ypp" +#line 478 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_string::ptr > ())), std::make_unique(yylhs.location)); } #line 2482 "parser.cpp" break; case 85: // stmt_default: "default" ":" -#line 479 "parser.ypp" +#line 483 "parser.ypp" { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2488 "parser.cpp" break; case 86: // stmt_break: "break" ";" -#line 484 "parser.ypp" +#line 488 "parser.ypp" { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } #line 2494 "parser.cpp" break; case 87: // stmt_continue: "continue" ";" -#line 489 "parser.ypp" +#line 493 "parser.ypp" { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } #line 2500 "parser.cpp" break; case 88: // stmt_return: "return" expr ";" -#line 494 "parser.ypp" +#line 498 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2506 "parser.cpp" break; case 89: // stmt_return: "return" ";" -#line 496 "parser.ypp" +#line 500 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2512 "parser.cpp" break; case 90: // stmt_breakpoint: "breakpoint" ";" -#line 501 "parser.ypp" +#line 505 "parser.ypp" { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } #line 2518 "parser.cpp" break; case 91: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 506 "parser.ypp" +#line 510 "parser.ypp" { yylhs.value.as < ast::stmt_prof_begin::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2524 "parser.cpp" break; case 92: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 511 "parser.ypp" +#line 515 "parser.ypp" { yylhs.value.as < ast::stmt_prof_end::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2530 "parser.cpp" break; case 93: // expr: expr_ternary -#line 515 "parser.ypp" +#line 519 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2536 "parser.cpp" break; case 94: // expr: expr_binary -#line 516 "parser.ypp" +#line 520 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2542 "parser.cpp" break; case 95: // expr: expr_primitive -#line 517 "parser.ypp" +#line 521 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2548 "parser.cpp" break; case 96: // expr_or_empty: expr -#line 521 "parser.ypp" +#line 525 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2554 "parser.cpp" break; case 97: // expr_or_empty: %empty -#line 522 "parser.ypp" +#line 526 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } #line 2560 "parser.cpp" break; case 98: // expr_assign: expr_object "=" expr -#line 527 "parser.ypp" +#line 531 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2566 "parser.cpp" break; case 99: // expr_assign: expr_object "|=" expr -#line 529 "parser.ypp" +#line 533 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2572 "parser.cpp" break; case 100: // expr_assign: expr_object "&=" expr -#line 531 "parser.ypp" +#line 535 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2578 "parser.cpp" break; case 101: // expr_assign: expr_object "^=" expr -#line 533 "parser.ypp" +#line 537 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2584 "parser.cpp" break; case 102: // expr_assign: expr_object "<<=" expr -#line 535 "parser.ypp" +#line 539 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()),std::move( yystack_[0].value.as < ast::expr > ())); } #line 2590 "parser.cpp" break; case 103: // expr_assign: expr_object ">>=" expr -#line 537 "parser.ypp" +#line 541 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2596 "parser.cpp" break; case 104: // expr_assign: expr_object "+=" expr -#line 539 "parser.ypp" +#line 543 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2602 "parser.cpp" break; case 105: // expr_assign: expr_object "-=" expr -#line 541 "parser.ypp" +#line 545 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2608 "parser.cpp" break; case 106: // expr_assign: expr_object "*=" expr -#line 543 "parser.ypp" +#line 547 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2614 "parser.cpp" break; case 107: // expr_assign: expr_object "/=" expr -#line 545 "parser.ypp" +#line 549 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2620 "parser.cpp" break; case 108: // expr_assign: expr_object "%=" expr -#line 547 "parser.ypp" +#line 551 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2626 "parser.cpp" break; case 109: // expr_increment: "++" expr_object -#line 552 "parser.ypp" +#line 556 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2632 "parser.cpp" break; case 110: // expr_increment: expr_object "++" -#line 554 "parser.ypp" +#line 558 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2638 "parser.cpp" break; case 111: // expr_decrement: "--" expr_object -#line 559 "parser.ypp" +#line 563 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2644 "parser.cpp" break; case 112: // expr_decrement: expr_object "--" -#line 561 "parser.ypp" +#line 565 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2650 "parser.cpp" break; case 113: // expr_ternary: expr "?" expr ":" expr -#line 566 "parser.ypp" +#line 570 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2656 "parser.cpp" break; case 114: // expr_binary: expr "||" expr -#line 571 "parser.ypp" +#line 575 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2662 "parser.cpp" break; case 115: // expr_binary: expr "&&" expr -#line 573 "parser.ypp" +#line 577 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2668 "parser.cpp" break; case 116: // expr_binary: expr "==" expr -#line 575 "parser.ypp" +#line 579 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2674 "parser.cpp" break; case 117: // expr_binary: expr "!=" expr -#line 577 "parser.ypp" +#line 581 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2680 "parser.cpp" break; case 118: // expr_binary: expr "<=" expr -#line 579 "parser.ypp" +#line 583 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2686 "parser.cpp" break; case 119: // expr_binary: expr ">=" expr -#line 581 "parser.ypp" +#line 585 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2692 "parser.cpp" break; case 120: // expr_binary: expr "<" expr -#line 583 "parser.ypp" +#line 587 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2698 "parser.cpp" break; case 121: // expr_binary: expr ">" expr -#line 585 "parser.ypp" +#line 589 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2704 "parser.cpp" break; case 122: // expr_binary: expr "|" expr -#line 587 "parser.ypp" +#line 591 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2710 "parser.cpp" break; case 123: // expr_binary: expr "&" expr -#line 589 "parser.ypp" +#line 593 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2716 "parser.cpp" break; case 124: // expr_binary: expr "^" expr -#line 591 "parser.ypp" +#line 595 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2722 "parser.cpp" break; case 125: // expr_binary: expr "<<" expr -#line 593 "parser.ypp" +#line 597 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2728 "parser.cpp" break; case 126: // expr_binary: expr ">>" expr -#line 595 "parser.ypp" +#line 599 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2734 "parser.cpp" break; case 127: // expr_binary: expr "+" expr -#line 597 "parser.ypp" +#line 601 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2740 "parser.cpp" break; case 128: // expr_binary: expr "-" expr -#line 599 "parser.ypp" +#line 603 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2746 "parser.cpp" break; case 129: // expr_binary: expr "*" expr -#line 601 "parser.ypp" +#line 605 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2752 "parser.cpp" break; case 130: // expr_binary: expr "/" expr -#line 603 "parser.ypp" +#line 607 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2758 "parser.cpp" break; case 131: // expr_binary: expr "%" expr -#line 605 "parser.ypp" +#line 609 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2764 "parser.cpp" break; case 132: // expr_primitive: expr_complement -#line 609 "parser.ypp" +#line 613 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } #line 2770 "parser.cpp" break; case 133: // expr_primitive: expr_not -#line 610 "parser.ypp" +#line 614 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } #line 2776 "parser.cpp" break; case 134: // expr_primitive: expr_call -#line 611 "parser.ypp" +#line 615 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 2782 "parser.cpp" break; case 135: // expr_primitive: expr_method -#line 612 "parser.ypp" +#line 616 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 2788 "parser.cpp" break; case 136: // expr_primitive: expr_add_array -#line 613 "parser.ypp" +#line 617 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } #line 2794 "parser.cpp" break; case 137: // expr_primitive: expr_reference -#line 614 "parser.ypp" +#line 618 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } #line 2800 "parser.cpp" break; case 138: // expr_primitive: expr_array -#line 615 "parser.ypp" +#line 619 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 2806 "parser.cpp" break; case 139: // expr_primitive: expr_field -#line 616 "parser.ypp" +#line 620 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 2812 "parser.cpp" break; case 140: // expr_primitive: expr_size -#line 617 "parser.ypp" +#line 621 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } #line 2818 "parser.cpp" break; case 141: // expr_primitive: expr_paren -#line 618 "parser.ypp" +#line 622 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } #line 2824 "parser.cpp" break; case 142: // expr_primitive: expr_thisthread -#line 619 "parser.ypp" +#line 623 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } #line 2830 "parser.cpp" break; case 143: // expr_primitive: expr_empty_array -#line 620 "parser.ypp" +#line 624 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } #line 2836 "parser.cpp" break; case 144: // expr_primitive: expr_undefined -#line 621 "parser.ypp" +#line 625 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } #line 2842 "parser.cpp" break; case 145: // expr_primitive: expr_game -#line 622 "parser.ypp" +#line 626 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 2848 "parser.cpp" break; case 146: // expr_primitive: expr_self -#line 623 "parser.ypp" +#line 627 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 2854 "parser.cpp" break; case 147: // expr_primitive: expr_anim -#line 624 "parser.ypp" +#line 628 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 2860 "parser.cpp" break; case 148: // expr_primitive: expr_level -#line 625 "parser.ypp" +#line 629 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 2866 "parser.cpp" break; case 149: // expr_primitive: expr_animation -#line 626 "parser.ypp" +#line 630 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } #line 2872 "parser.cpp" break; case 150: // expr_primitive: expr_animtree -#line 627 "parser.ypp" +#line 631 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } #line 2878 "parser.cpp" break; case 151: // expr_primitive: expr_identifier -#line 628 "parser.ypp" +#line 632 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 2884 "parser.cpp" break; case 152: // expr_primitive: expr_istring -#line 629 "parser.ypp" +#line 633 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } #line 2890 "parser.cpp" break; case 153: // expr_primitive: expr_string -#line 630 "parser.ypp" +#line 634 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } #line 2896 "parser.cpp" break; case 154: // expr_primitive: expr_vector -#line 631 "parser.ypp" +#line 635 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } #line 2902 "parser.cpp" break; case 155: // expr_primitive: expr_float -#line 632 "parser.ypp" +#line 636 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } #line 2908 "parser.cpp" break; case 156: // expr_primitive: expr_integer -#line 633 "parser.ypp" +#line 637 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } #line 2914 "parser.cpp" break; case 157: // expr_primitive: expr_false -#line 634 "parser.ypp" +#line 638 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } #line 2920 "parser.cpp" break; case 158: // expr_primitive: expr_true -#line 635 "parser.ypp" +#line 639 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } #line 2926 "parser.cpp" break; case 159: // expr_complement: "~" expr -#line 640 "parser.ypp" +#line 644 "parser.ypp" { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2932 "parser.cpp" break; case 160: // expr_not: "!" expr -#line 645 "parser.ypp" +#line 649 "parser.ypp" { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2938 "parser.cpp" break; case 161: // expr_call: expr_function -#line 649 "parser.ypp" +#line 653 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2944 "parser.cpp" break; case 162: // expr_call: expr_pointer -#line 650 "parser.ypp" +#line 654 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2950 "parser.cpp" break; case 163: // expr_method: expr_object expr_function -#line 653 "parser.ypp" +#line 657 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 2956 "parser.cpp" break; case 164: // expr_method: expr_object expr_pointer -#line 654 "parser.ypp" +#line 658 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 2962 "parser.cpp" break; case 165: // expr_function: expr_identifier "(" expr_arguments ")" -#line 659 "parser.ypp" +#line 663 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2968 "parser.cpp" break; case 166: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 661 "parser.ypp" +#line 665 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2974 "parser.cpp" break; case 167: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 663 "parser.ypp" +#line 667 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2980 "parser.cpp" break; case 168: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 665 "parser.ypp" +#line 669 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2986 "parser.cpp" break; case 169: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 667 "parser.ypp" +#line 671 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2992 "parser.cpp" break; case 170: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 669 "parser.ypp" +#line 673 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2998 "parser.cpp" break; case 171: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 674 "parser.ypp" +#line 678 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3004 "parser.cpp" break; case 172: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 676 "parser.ypp" +#line 680 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3010 "parser.cpp" break; case 173: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 678 "parser.ypp" +#line 682 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 3016 "parser.cpp" break; case 174: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 680 "parser.ypp" +#line 684 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::builtin); } #line 3022 "parser.cpp" break; case 175: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 685 "parser.ypp" +#line 689 "parser.ypp" { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } #line 3028 "parser.cpp" break; case 176: // expr_parameters: expr_parameters "," expr_identifier -#line 690 "parser.ypp" +#line 694 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3034 "parser.cpp" break; case 177: // expr_parameters: expr_identifier -#line 692 "parser.ypp" +#line 696 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3040 "parser.cpp" break; case 178: // expr_parameters: %empty -#line 694 "parser.ypp" +#line 698 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } #line 3046 "parser.cpp" break; case 179: // expr_arguments: expr_arguments_no_empty -#line 699 "parser.ypp" +#line 703 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } #line 3052 "parser.cpp" break; case 180: // expr_arguments: %empty -#line 701 "parser.ypp" +#line 705 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } #line 3058 "parser.cpp" break; case 181: // expr_arguments_no_empty: expr_arguments "," expr -#line 706 "parser.ypp" +#line 710 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ()); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3064 "parser.cpp" break; case 182: // expr_arguments_no_empty: expr -#line 708 "parser.ypp" +#line 712 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3070 "parser.cpp" break; case 183: // expr_reference: "::" expr_identifier -#line 713 "parser.ypp" +#line 717 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3076 "parser.cpp" break; case 184: // expr_reference: expr_path "::" expr_identifier -#line 715 "parser.ypp" +#line 719 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_path::ptr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3082 "parser.cpp" break; case 185: // expr_array: expr_object "[" expr "]" -#line 720 "parser.ypp" +#line 724 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3088 "parser.cpp" break; case 186: // expr_field: expr_object "." expr_identifier_nosize -#line 725 "parser.ypp" +#line 729 "parser.ypp" { yylhs.value.as < ast::expr_field::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3094 "parser.cpp" break; case 187: // expr_size: expr_object "." "size" -#line 730 "parser.ypp" +#line 734 "parser.ypp" { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } #line 3100 "parser.cpp" break; case 188: // expr_paren: "(" expr ")" -#line 735 "parser.ypp" +#line 739 "parser.ypp" { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3106 "parser.cpp" break; case 189: // expr_object: expr_call -#line 739 "parser.ypp" +#line 743 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 3112 "parser.cpp" break; case 190: // expr_object: expr_method -#line 740 "parser.ypp" +#line 744 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 3118 "parser.cpp" break; case 191: // expr_object: expr_array -#line 741 "parser.ypp" +#line 745 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 3124 "parser.cpp" break; case 192: // expr_object: expr_field -#line 742 "parser.ypp" +#line 746 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 3130 "parser.cpp" break; case 193: // expr_object: expr_game -#line 743 "parser.ypp" +#line 747 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 3136 "parser.cpp" break; case 194: // expr_object: expr_self -#line 744 "parser.ypp" +#line 748 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 3142 "parser.cpp" break; case 195: // expr_object: expr_anim -#line 745 "parser.ypp" +#line 749 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 3148 "parser.cpp" break; case 196: // expr_object: expr_level -#line 746 "parser.ypp" +#line 750 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 3154 "parser.cpp" break; case 197: // expr_object: expr_identifier -#line 747 "parser.ypp" +#line 751 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 3160 "parser.cpp" break; case 198: // expr_thisthread: "thisthread" -#line 752 "parser.ypp" +#line 756 "parser.ypp" { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } #line 3166 "parser.cpp" break; case 199: // expr_empty_array: "[" "]" -#line 757 "parser.ypp" +#line 761 "parser.ypp" { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } #line 3172 "parser.cpp" break; case 200: // expr_undefined: "undefined" -#line 762 "parser.ypp" +#line 766 "parser.ypp" { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } #line 3178 "parser.cpp" break; case 201: // expr_game: "game" -#line 767 "parser.ypp" +#line 771 "parser.ypp" { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } #line 3184 "parser.cpp" break; case 202: // expr_self: "self" -#line 772 "parser.ypp" +#line 776 "parser.ypp" { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } #line 3190 "parser.cpp" break; case 203: // expr_anim: "anim" -#line 777 "parser.ypp" +#line 781 "parser.ypp" { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } #line 3196 "parser.cpp" break; case 204: // expr_level: "level" -#line 782 "parser.ypp" +#line 786 "parser.ypp" { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } #line 3202 "parser.cpp" break; case 205: // expr_animation: "%" "identifier" -#line 787 "parser.ypp" +#line 791 "parser.ypp" { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3208 "parser.cpp" break; case 206: // expr_animtree: "#animtree" -#line 792 "parser.ypp" +#line 796 "parser.ypp" { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } #line 3214 "parser.cpp" break; case 207: // expr_identifier_nosize: "identifier" -#line 797 "parser.ypp" +#line 801 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3220 "parser.cpp" break; case 208: // expr_identifier: "identifier" -#line 802 "parser.ypp" +#line 806 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3226 "parser.cpp" break; case 209: // expr_identifier: "size" -#line 804 "parser.ypp" +#line 808 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } #line 3232 "parser.cpp" break; case 210: // expr_path: "identifier" -#line 809 "parser.ypp" +#line 813 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3238 "parser.cpp" break; case 211: // expr_path: "path" -#line 811 "parser.ypp" +#line 815 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3244 "parser.cpp" break; case 212: // expr_istring: "localized string" -#line 816 "parser.ypp" +#line 820 "parser.ypp" { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3250 "parser.cpp" break; case 213: // expr_string: "string literal" -#line 821 "parser.ypp" +#line 825 "parser.ypp" { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3256 "parser.cpp" break; case 214: // expr_vector: "(" expr "," expr "," expr ")" -#line 826 "parser.ypp" +#line 830 "parser.ypp" { yylhs.value.as < ast::expr_vector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3262 "parser.cpp" break; case 215: // expr_float: "-" "float" -#line 831 "parser.ypp" +#line 835 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3268 "parser.cpp" break; case 216: // expr_float: "float" -#line 833 "parser.ypp" +#line 837 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3274 "parser.cpp" break; case 217: // expr_integer: "-" "integer" -#line 838 "parser.ypp" +#line 842 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3280 "parser.cpp" break; case 218: // expr_integer: "integer" -#line 840 "parser.ypp" +#line 844 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3286 "parser.cpp" break; case 219: // expr_false: "false" -#line 845 "parser.ypp" +#line 849 "parser.ypp" { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } #line 3292 "parser.cpp" break; case 220: // expr_true: "true" -#line 850 "parser.ypp" +#line 854 "parser.ypp" { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } #line 3298 "parser.cpp" break; @@ -3562,6 +3562,8 @@ namespace xsk { namespace gsc { namespace s1 { } + + bool parser::yy_lac_check_ (symbol_kind_type yytoken) const { @@ -3666,7 +3668,9 @@ namespace xsk { namespace gsc { namespace s1 { follows. If no initial context is currently established for the current lookahead, then check if that lookahead can eventually be shifted if syntactic actions continue from the current context. */ - if (!yy_lac_established_) + if (yy_lac_established_) + return true; + else { #if S1DEBUG YYCDEBUG << "LAC: initial context established for " @@ -3675,12 +3679,11 @@ namespace xsk { namespace gsc { namespace s1 { yy_lac_established_ = true; return yy_lac_check_ (yytoken); } - return true; } // Discard any previous initial lookahead context. void - parser::yy_lac_discard_ (const char* evt) + parser::yy_lac_discard_ (const char* event) { /* Discard any previous initial lookahead context because of Event, which may be a lookahead change or an invalidation of the currently @@ -3696,11 +3699,12 @@ namespace xsk { namespace gsc { namespace s1 { if (yy_lac_established_) { YYCDEBUG << "LAC: initial context discarded due to " - << evt << '\n'; + << event << '\n'; yy_lac_established_ = false; } } + int parser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -4487,29 +4491,29 @@ namespace xsk { namespace gsc { namespace s1 { const short parser::yyrline_[] = { - 0, 255, 255, 256, 260, 262, 264, 266, 268, 270, - 275, 279, 284, 285, 286, 287, 288, 292, 297, 302, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 335, 336, 340, 342, 347, - 349, 354, 355, 359, 360, 364, 366, 368, 371, 375, - 377, 382, 384, 386, 391, 396, 398, 403, 408, 410, - 415, 417, 422, 427, 429, 434, 439, 444, 449, 454, - 459, 461, 466, 471, 473, 478, 483, 488, 493, 495, - 500, 505, 510, 515, 516, 517, 521, 522, 526, 528, - 530, 532, 534, 536, 538, 540, 542, 544, 546, 551, - 553, 558, 560, 565, 570, 572, 574, 576, 578, 580, - 582, 584, 586, 588, 590, 592, 594, 596, 598, 600, - 602, 604, 609, 610, 611, 612, 613, 614, 615, 616, - 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 639, - 644, 649, 650, 653, 654, 658, 660, 662, 664, 666, - 668, 673, 675, 677, 679, 684, 689, 691, 694, 698, - 701, 705, 707, 712, 714, 719, 724, 729, 734, 739, - 740, 741, 742, 743, 744, 745, 746, 747, 751, 756, - 761, 766, 771, 776, 781, 786, 791, 796, 801, 803, - 808, 810, 815, 820, 825, 830, 832, 837, 839, 844, - 849 + 0, 259, 259, 260, 264, 266, 268, 270, 272, 274, + 279, 283, 288, 289, 290, 291, 292, 296, 301, 306, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 339, 340, 344, 346, 351, + 353, 358, 359, 363, 364, 368, 370, 372, 375, 379, + 381, 386, 388, 390, 395, 400, 402, 407, 412, 414, + 419, 421, 426, 431, 433, 438, 443, 448, 453, 458, + 463, 465, 470, 475, 477, 482, 487, 492, 497, 499, + 504, 509, 514, 519, 520, 521, 525, 526, 530, 532, + 534, 536, 538, 540, 542, 544, 546, 548, 550, 555, + 557, 562, 564, 569, 574, 576, 578, 580, 582, 584, + 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, + 606, 608, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 643, + 648, 653, 654, 657, 658, 662, 664, 666, 668, 670, + 672, 677, 679, 681, 683, 688, 693, 695, 698, 702, + 705, 709, 711, 716, 718, 723, 728, 733, 738, 743, + 744, 745, 746, 747, 748, 749, 750, 751, 755, 760, + 765, 770, 775, 780, 785, 790, 795, 800, 805, 807, + 812, 814, 819, 824, 829, 834, 836, 841, 843, 848, + 853 }; void @@ -4542,9 +4546,9 @@ namespace xsk { namespace gsc { namespace s1 { #line 13 "parser.ypp" } } } // xsk::gsc::s1 -#line 4546 "parser.cpp" +#line 4550 "parser.cpp" -#line 853 "parser.ypp" +#line 857 "parser.ypp" void xsk::gsc::s1::parser::error(const xsk::gsc::location& loc, const std::string& msg) diff --git a/src/s1/xsk/parser.hpp b/src/s1/xsk/parser.hpp index 92ad9d47..29d15111 100644 --- a/src/s1/xsk/parser.hpp +++ b/src/s1/xsk/parser.hpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -47,10 +47,14 @@ // "%code requires" blocks. #line 28 "parser.ypp" +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "s1.hpp" namespace xsk::gsc::s1 { class lexer; } -#line 54 "parser.hpp" +#line 58 "parser.hpp" # include # include // std::abort @@ -126,12 +130,18 @@ namespace xsk::gsc::s1 { class lexer; } # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -193,7 +203,7 @@ namespace xsk::gsc::s1 { class lexer; } #line 13 "parser.ypp" namespace xsk { namespace gsc { namespace s1 { -#line 197 "parser.hpp" +#line 207 "parser.hpp" @@ -202,27 +212,32 @@ namespace xsk { namespace gsc { namespace s1 { class parser { public: -#ifndef S1STYPE +#ifdef S1STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define S1STYPE in C++, use %define api.value.type" +# endif + typedef S1STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { S1_ASSERT (sizeof (T) <= size); @@ -231,13 +246,13 @@ namespace xsk { namespace gsc { namespace s1 { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { S1_ASSERT (!yytypeid_); } @@ -381,7 +396,7 @@ namespace xsk { namespace gsc { namespace s1 { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -391,7 +406,7 @@ namespace xsk { namespace gsc { namespace s1 { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -400,7 +415,7 @@ namespace xsk { namespace gsc { namespace s1 { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -635,18 +650,19 @@ namespace xsk { namespace gsc { namespace s1 { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef S1STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef xsk::gsc::location location_type; @@ -793,7 +809,7 @@ namespace xsk { namespace gsc { namespace s1 { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -1023,7 +1039,7 @@ namespace xsk { namespace gsc { namespace s1 { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -2291,6 +2307,8 @@ namespace xsk { namespace gsc { namespace s1 { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -2617,7 +2635,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -2632,22 +2650,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { - /// Default constructor. - by_kind (); - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that); -#endif - - /// Copy constructor. - by_kind (const by_kind& that); - /// The symbol kind as needed by the constructor. typedef token_kind_type kind_type; + /// Default constructor. + by_kind () YY_NOEXCEPT; + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that) YY_NOEXCEPT; +#endif + + /// Copy constructor. + by_kind (const by_kind& that) YY_NOEXCEPT; + /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -2677,30 +2697,34 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ S1_ASSERT (tok == token::S1EOF || (token::S1error <= tok && tok <= token::MOD) || (token::SIZEOF <= tok && tok <= token::POSTDEC)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ S1_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); +#endif } }; @@ -2749,7 +2773,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static const char *symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -4501,19 +4525,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const short yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; @@ -4540,14 +4564,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const unsigned char yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const unsigned char yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -4646,7 +4670,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -4725,7 +4749,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -4784,7 +4808,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -4803,7 +4827,7 @@ switch (yykind) inline parser::symbol_kind_type - parser::yytranslate_ (int t) + parser::yytranslate_ (int t) YY_NOEXCEPT { return static_cast (t); } @@ -5112,6 +5136,7 @@ switch (yykind) + template parser::symbol_kind_type parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -5119,6 +5144,7 @@ switch (yykind) return this->kind (); } + template bool parser::basic_symbol::empty () const YY_NOEXCEPT @@ -5429,13 +5455,13 @@ switch (yykind) // by_kind. inline - parser::by_kind::by_kind () + parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - parser::by_kind::by_kind (by_kind&& that) + parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -5443,15 +5469,17 @@ switch (yykind) #endif inline - parser::by_kind::by_kind (const by_kind& that) + parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - parser::by_kind::by_kind (token_kind_type t) + parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void parser::by_kind::clear () YY_NOEXCEPT @@ -5474,6 +5502,7 @@ switch (yykind) return kind_; } + inline parser::symbol_kind_type parser::by_kind::type_get () const YY_NOEXCEPT @@ -5481,9 +5510,10 @@ switch (yykind) return this->kind (); } + #line 13 "parser.ypp" } } } // xsk::gsc::s1 -#line 5487 "parser.hpp" +#line 5517 "parser.hpp" diff --git a/src/s1/xsk/resolver.cpp b/src/s1/xsk/resolver.cpp index 34cc153d..5c826e33 100644 --- a/src/s1/xsk/resolver.cpp +++ b/src/s1/xsk/resolver.cpp @@ -6,6 +6,11 @@ #include "stdafx.hpp" #include "s1.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4244) +#endif + namespace xsk::gsc::s1 { @@ -61,7 +66,7 @@ auto resolver::function_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_func_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = function_map_rev.find(name); @@ -90,7 +95,7 @@ auto resolver::method_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_meth_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = method_map_rev.find(name); @@ -119,7 +124,7 @@ auto resolver::file_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = file_map_rev.find(name); @@ -148,7 +153,7 @@ auto resolver::token_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = token_map_rev.find(name); @@ -212,7 +217,7 @@ auto resolver::make_token(std::string_view str) -> std::string for (std::size_t i = 0; i < data.size(); i++) { - data[i] = std::tolower(str[i]); + data[i] = static_cast(std::tolower(static_cast(str[i]))); if (data[i] == '\\') data[i] = '/'; } @@ -2662,3 +2667,7 @@ struct __init__ __init__ _; } // namespace xsk::gsc::s1 + +#ifdef _MSC_VER +#pragma warning(pop) +#endif diff --git a/src/s2/stdafx.hpp b/src/s2/stdafx.hpp index 36a732e0..19f22f43 100644 --- a/src/s2/stdafx.hpp +++ b/src/s2/stdafx.hpp @@ -5,38 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4005) -#pragma warning(disable:4018) -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4389) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include -// Ext using namespace std::literals; - -#include "xsk/s2.hpp" diff --git a/src/s2/xsk/assembler.cpp b/src/s2/xsk/assembler.cpp index 20d3792a..428a0ee9 100644 --- a/src/s2/xsk/assembler.cpp +++ b/src/s2/xsk/assembler.cpp @@ -143,7 +143,7 @@ void assembler::assemble_function(const function::ptr& func) func->id = resolver::token_id(func->name); stack_->write(func->size); - stack_->write(func->id); + stack_->write(static_cast(func->id)); if (func->id == 0) { @@ -454,7 +454,7 @@ void assembler::assemble_end_switch(const instruction::ptr& inst) const auto count = std::stoul(inst->data[0]); - script_->write(count); + script_->write(static_cast(count)); std::uint32_t index = inst->index + 3; @@ -521,15 +521,15 @@ void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back if (expr) { - script_->write(addr - inst->index - 3); + script_->write(static_cast(addr - inst->index - 3)); } else if (back) { - script_->write((inst->index + 3) - addr); + script_->write(static_cast((inst->index + 3) - addr)); } else { - script_->write(addr - inst->index - 5); + script_->write(static_cast(addr - inst->index - 5)); } } @@ -548,11 +548,11 @@ void assembler::assemble_offset(std::int32_t offset) auto assembler::resolve_function(const std::string& name) -> std::int32_t { - for (const auto& func : functions_) + for (const auto& entry : functions_) { - if (func->name == name) + if (entry->name == name) { - return func->index; + return entry->index; } } @@ -561,11 +561,11 @@ auto assembler::resolve_function(const std::string& name) -> std::int32_t auto assembler::resolve_label(const std::string& name) -> std::int32_t { - for (const auto& func : labels_) + for (const auto& entry : labels_) { - if (func.second == name) + if (entry.second == name) { - return func.first; + return entry.first; } } diff --git a/src/s2/xsk/compiler.cpp b/src/s2/xsk/compiler.cpp index 178cb0cc..dda744ca 100644 --- a/src/s2/xsk/compiler.cpp +++ b/src/s2/xsk/compiler.cpp @@ -848,7 +848,7 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: emit_opcode(opcode::OP_endswitch, data); - auto offset = 7 * stmt->stmt->list.size(); + auto offset = static_cast(7 * stmt->stmt->list.size()); function_->instructions.back()->size += offset; index_ += offset; @@ -2669,7 +2669,7 @@ auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const { if (blk->local_vars.at(i).init) { - return blk->local_vars_create_count - 1 - i; + return static_cast(blk->local_vars_create_count - 1 - i); } throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); diff --git a/src/s2/xsk/decompiler.cpp b/src/s2/xsk/decompiler.cpp index d9061ae7..b7253dd8 100644 --- a/src/s2/xsk/decompiler.cpp +++ b/src/s2/xsk/decompiler.cpp @@ -1794,7 +1794,7 @@ void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) void decompiler::decompile_infinites(const ast::stmt_list::ptr& stmt) { - for (int i = stmt->list.size() - 1; i >= 0; i--) + for (auto i = stmt->list.size() - 1; i > 0; i--) { if (stmt->list.at(i) == ast::kind::asm_jump_back) { @@ -1957,7 +1957,7 @@ void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) } } -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_end = stmt->list.at(begin).as_cond->value; @@ -1985,7 +1985,7 @@ void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t beg stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.loc_end = stmt->list.at(end).loc().label(); @@ -2036,7 +2036,7 @@ void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.is_last = true; @@ -2096,7 +2096,7 @@ void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uin } } -void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); @@ -2126,7 +2126,7 @@ void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32 stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t start, std::uint32_t end) +void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::size_t start, std::size_t end) { auto& last = block->list.at(end - 1); @@ -2191,7 +2191,7 @@ void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t decompile_while(block, start, end); } -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2221,7 +2221,7 @@ void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2252,7 +2252,7 @@ void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2306,7 +2306,7 @@ void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t be stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2373,7 +2373,7 @@ void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t start) +void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) { block blk; blk.loc_continue = blocks_.back().loc_continue; @@ -2486,7 +2486,7 @@ void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); } -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool +auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool { for (auto i = begin; i < end; i++) { @@ -2505,7 +2505,7 @@ auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::u return false; } -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t +auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t { auto index = 0u; @@ -2523,7 +2523,7 @@ auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std: throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); } -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool +auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool { if (index == stmt->list.size() - 1) return true; @@ -3341,7 +3341,7 @@ void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) { - blk->local_vars_public_count = blk->local_vars.size() - std::stoi(expr->index); + blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); } } // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/decompiler.hpp b/src/s2/xsk/decompiler.hpp index c134abf1..daf9445c 100644 --- a/src/s2/xsk/decompiler.hpp +++ b/src/s2/xsk/decompiler.hpp @@ -34,19 +34,19 @@ private: void decompile_switches(const ast::stmt_list::ptr& stmt); void decompile_ifelses(const ast::stmt_list::ptr& stmt); void decompile_aborts(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool; + void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); + auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; + auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; + auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; void process_stack(const ast::decl_thread::ptr& thread); void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); void process_stmt(const ast::stmt& stmt, const block::ptr& blk); diff --git a/src/s2/xsk/disassembler.cpp b/src/s2/xsk/disassembler.cpp index 86e4e59b..6821545b 100644 --- a/src/s2/xsk/disassembler.cpp +++ b/src/s2/xsk/disassembler.cpp @@ -51,7 +51,7 @@ void disassembler::disassemble(const std::string& file, std::vectorindex = static_cast(script_->pos()); func->size = stack_->read(); func->id = stack_->read(); - func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id); + func->name = func->id == 0 ? stack_->read_c_string() : resolver::token_name(static_cast(func->id)); dissasemble_function(func); diff --git a/src/s2/xsk/lexer.cpp b/src/s2/xsk/lexer.cpp index 139fb752..5154ce93 100644 --- a/src/s2/xsk/lexer.cpp +++ b/src/s2/xsk/lexer.cpp @@ -97,7 +97,7 @@ void reader::init(const char* data, size_t size) { state = reader::ok; buffer_pos = data; - bytes_remaining = size; + bytes_remaining = static_cast(size); last_byte = 0; current_byte = *data; } diff --git a/src/s2/xsk/parser.cpp b/src/s2/xsk/parser.cpp index bd46209f..35635bca 100644 --- a/src/s2/xsk/parser.cpp +++ b/src/s2/xsk/parser.cpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -35,7 +35,7 @@ // private implementation details that can be changed or removed. // "%code top" blocks. -#line 34 "parser.ypp" +#line 38 "parser.ypp" #include "stdafx.hpp" #include "parser.hpp" @@ -166,9 +166,9 @@ namespace xsk { namespace gsc { namespace s2 { parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -1467,7 +1467,7 @@ namespace xsk { namespace gsc { namespace s2 { } void - parser::yypop_ (int n) + parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -1510,13 +1510,13 @@ namespace xsk { namespace gsc { namespace s2 { } bool - parser::yy_pact_value_is_default_ (int yyvalue) + parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - parser::yy_table_value_is_error_ (int yyvalue) + parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -1547,8 +1547,8 @@ namespace xsk { namespace gsc { namespace s2 { /// The return value of parse (). int yyresult; - /// Discard the LAC context in case there still is one left from a - /// previous invocation. + // Discard the LAC context in case there still is one left from a + // previous invocation. yy_lac_discard_ ("init"); #if YY_EXCEPTIONS @@ -1626,7 +1626,7 @@ namespace xsk { namespace gsc { namespace s2 { if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) { if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; goto yydefault; } @@ -1637,7 +1637,7 @@ namespace xsk { namespace gsc { namespace s2 { if (yy_table_value_is_error_ (yyn)) goto yyerrlab; if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -1984,1315 +1984,1315 @@ namespace xsk { namespace gsc { namespace s2 { switch (yyn) { case 2: // root: program -#line 255 "parser.ypp" +#line 259 "parser.ypp" { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } #line 1990 "parser.cpp" break; case 3: // root: %empty -#line 256 "parser.ypp" +#line 260 "parser.ypp" { ast = std::make_unique(yylhs.location); } #line 1996 "parser.cpp" break; case 4: // program: program inline -#line 261 "parser.ypp" +#line 265 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } #line 2002 "parser.cpp" break; case 5: // program: program include -#line 263 "parser.ypp" +#line 267 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2008 "parser.cpp" break; case 6: // program: program declaration -#line 265 "parser.ypp" +#line 269 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2014 "parser.cpp" break; case 7: // program: inline -#line 267 "parser.ypp" +#line 271 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } #line 2020 "parser.cpp" break; case 8: // program: include -#line 269 "parser.ypp" +#line 273 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2026 "parser.cpp" break; case 9: // program: declaration -#line 271 "parser.ypp" +#line 275 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2032 "parser.cpp" break; case 10: // inline: "#inline" expr_path ";" -#line 275 "parser.ypp" +#line 279 "parser.ypp" { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } #line 2038 "parser.cpp" break; case 11: // include: "#include" expr_path ";" -#line 280 "parser.ypp" +#line 284 "parser.ypp" { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } #line 2044 "parser.cpp" break; case 12: // declaration: "/#" -#line 284 "parser.ypp" +#line 288 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } #line 2050 "parser.cpp" break; case 13: // declaration: "#/" -#line 285 "parser.ypp" +#line 289 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } #line 2056 "parser.cpp" break; case 14: // declaration: decl_usingtree -#line 286 "parser.ypp" +#line 290 "parser.ypp" { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } #line 2062 "parser.cpp" break; case 15: // declaration: decl_constant -#line 287 "parser.ypp" +#line 291 "parser.ypp" { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } #line 2068 "parser.cpp" break; case 16: // declaration: decl_thread -#line 288 "parser.ypp" +#line 292 "parser.ypp" { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } #line 2074 "parser.cpp" break; case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 293 "parser.ypp" +#line 297 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_usingtree::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_string::ptr > ())); } #line 2080 "parser.cpp" break; case 18: // decl_constant: expr_identifier "=" expr ";" -#line 298 "parser.ypp" +#line 302 "parser.ypp" { yylhs.value.as < ast::decl_constant::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 2086 "parser.cpp" break; case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 303 "parser.ypp" +#line 307 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2092 "parser.cpp" break; case 20: // stmt: stmt_block -#line 307 "parser.ypp" +#line 311 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } #line 2098 "parser.cpp" break; case 21: // stmt: stmt_call -#line 308 "parser.ypp" +#line 312 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } #line 2104 "parser.cpp" break; case 22: // stmt: stmt_assign -#line 309 "parser.ypp" +#line 313 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } #line 2110 "parser.cpp" break; case 23: // stmt: stmt_endon -#line 310 "parser.ypp" +#line 314 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } #line 2116 "parser.cpp" break; case 24: // stmt: stmt_notify -#line 311 "parser.ypp" +#line 315 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } #line 2122 "parser.cpp" break; case 25: // stmt: stmt_wait -#line 312 "parser.ypp" +#line 316 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } #line 2128 "parser.cpp" break; case 26: // stmt: stmt_waittill -#line 313 "parser.ypp" +#line 317 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } #line 2134 "parser.cpp" break; case 27: // stmt: stmt_waittillmatch -#line 314 "parser.ypp" +#line 318 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } #line 2140 "parser.cpp" break; case 28: // stmt: stmt_waittillframeend -#line 315 "parser.ypp" +#line 319 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } #line 2146 "parser.cpp" break; case 29: // stmt: stmt_waitframe -#line 316 "parser.ypp" +#line 320 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waitframe = std::move(yystack_[0].value.as < ast::stmt_waitframe::ptr > ()); } #line 2152 "parser.cpp" break; case 30: // stmt: stmt_if -#line 317 "parser.ypp" +#line 321 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } #line 2158 "parser.cpp" break; case 31: // stmt: stmt_ifelse -#line 318 "parser.ypp" +#line 322 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } #line 2164 "parser.cpp" break; case 32: // stmt: stmt_while -#line 319 "parser.ypp" +#line 323 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } #line 2170 "parser.cpp" break; case 33: // stmt: stmt_dowhile -#line 320 "parser.ypp" +#line 324 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } #line 2176 "parser.cpp" break; case 34: // stmt: stmt_for -#line 321 "parser.ypp" +#line 325 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } #line 2182 "parser.cpp" break; case 35: // stmt: stmt_foreach -#line 322 "parser.ypp" +#line 326 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } #line 2188 "parser.cpp" break; case 36: // stmt: stmt_switch -#line 323 "parser.ypp" +#line 327 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } #line 2194 "parser.cpp" break; case 37: // stmt: stmt_case -#line 324 "parser.ypp" +#line 328 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } #line 2200 "parser.cpp" break; case 38: // stmt: stmt_default -#line 325 "parser.ypp" +#line 329 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } #line 2206 "parser.cpp" break; case 39: // stmt: stmt_break -#line 326 "parser.ypp" +#line 330 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } #line 2212 "parser.cpp" break; case 40: // stmt: stmt_continue -#line 327 "parser.ypp" +#line 331 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } #line 2218 "parser.cpp" break; case 41: // stmt: stmt_return -#line 328 "parser.ypp" +#line 332 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } #line 2224 "parser.cpp" break; case 42: // stmt: stmt_breakpoint -#line 329 "parser.ypp" +#line 333 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } #line 2230 "parser.cpp" break; case 43: // stmt: stmt_prof_begin -#line 330 "parser.ypp" +#line 334 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } #line 2236 "parser.cpp" break; case 44: // stmt: stmt_prof_end -#line 331 "parser.ypp" +#line 335 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } #line 2242 "parser.cpp" break; case 45: // stmt_or_dev: stmt -#line 335 "parser.ypp" +#line 339 "parser.ypp" { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } #line 2248 "parser.cpp" break; case 46: // stmt_or_dev: stmt_dev -#line 336 "parser.ypp" +#line 340 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } #line 2254 "parser.cpp" break; case 47: // stmt_list: stmt_list stmt -#line 341 "parser.ypp" +#line 345 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2260 "parser.cpp" break; case 48: // stmt_list: stmt -#line 343 "parser.ypp" +#line 347 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2266 "parser.cpp" break; case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 348 "parser.ypp" +#line 352 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2272 "parser.cpp" break; case 50: // stmt_or_dev_list: stmt_or_dev -#line 350 "parser.ypp" +#line 354 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2278 "parser.cpp" break; case 51: // stmt_dev: "/#" stmt_list "#/" -#line 354 "parser.ypp" +#line 358 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::stmt_list::ptr > ())); } #line 2284 "parser.cpp" break; case 52: // stmt_dev: "/#" "#/" -#line 355 "parser.ypp" +#line 359 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2290 "parser.cpp" break; case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 359 "parser.ypp" +#line 363 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } #line 2296 "parser.cpp" break; case 54: // stmt_block: "{" "}" -#line 360 "parser.ypp" +#line 364 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } #line 2302 "parser.cpp" break; case 55: // stmt_expr: expr_assign -#line 365 "parser.ypp" +#line 369 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2308 "parser.cpp" break; case 56: // stmt_expr: expr_increment -#line 367 "parser.ypp" +#line 371 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2314 "parser.cpp" break; case 57: // stmt_expr: expr_decrement -#line 369 "parser.ypp" +#line 373 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2320 "parser.cpp" break; case 58: // stmt_expr: %empty -#line 371 "parser.ypp" +#line 375 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2326 "parser.cpp" break; case 59: // stmt_call: expr_call ";" -#line 376 "parser.ypp" +#line 380 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_call::ptr > ()))); } #line 2332 "parser.cpp" break; case 60: // stmt_call: expr_method ";" -#line 378 "parser.ypp" +#line 382 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_method::ptr > ()))); } #line 2338 "parser.cpp" break; case 61: // stmt_assign: expr_assign ";" -#line 383 "parser.ypp" +#line 387 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2344 "parser.cpp" break; case 62: // stmt_assign: expr_increment ";" -#line 385 "parser.ypp" +#line 389 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2350 "parser.cpp" break; case 63: // stmt_assign: expr_decrement ";" -#line 387 "parser.ypp" +#line 391 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2356 "parser.cpp" break; case 64: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 392 "parser.ypp" +#line 396 "parser.ypp" { yylhs.value.as < ast::stmt_endon::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ())); } #line 2362 "parser.cpp" break; case 65: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 397 "parser.ypp" +#line 401 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2368 "parser.cpp" break; case 66: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 399 "parser.ypp" +#line 403 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2374 "parser.cpp" break; case 67: // stmt_wait: "wait" expr ";" -#line 404 "parser.ypp" +#line 408 "parser.ypp" { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2380 "parser.cpp" break; case 68: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 409 "parser.ypp" +#line 413 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2386 "parser.cpp" break; case 69: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 411 "parser.ypp" +#line 415 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2392 "parser.cpp" break; case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 416 "parser.ypp" +#line 420 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2398 "parser.cpp" break; case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 418 "parser.ypp" +#line 422 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2404 "parser.cpp" break; case 72: // stmt_waittillframeend: "waittillframeend" ";" -#line 423 "parser.ypp" +#line 427 "parser.ypp" { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } #line 2410 "parser.cpp" break; case 73: // stmt_waitframe: "waitframe" ";" -#line 428 "parser.ypp" +#line 432 "parser.ypp" { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } #line 2416 "parser.cpp" break; case 74: // stmt_waitframe: "waitframe" "(" ")" ";" -#line 430 "parser.ypp" +#line 434 "parser.ypp" { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } #line 2422 "parser.cpp" break; case 75: // stmt_if: "if" "(" expr ")" stmt -#line 435 "parser.ypp" +#line 439 "parser.ypp" { yylhs.value.as < ast::stmt_if::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2428 "parser.cpp" break; case 76: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 440 "parser.ypp" +#line 444 "parser.ypp" { yylhs.value.as < ast::stmt_ifelse::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::stmt > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2434 "parser.cpp" break; case 77: // stmt_while: "while" "(" expr ")" stmt -#line 445 "parser.ypp" +#line 449 "parser.ypp" { yylhs.value.as < ast::stmt_while::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2440 "parser.cpp" break; case 78: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 450 "parser.ypp" +#line 454 "parser.ypp" { yylhs.value.as < ast::stmt_dowhile::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[5].value.as < ast::stmt > ())); } #line 2446 "parser.cpp" break; case 79: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 455 "parser.ypp" +#line 459 "parser.ypp" { yylhs.value.as < ast::stmt_for::ptr > () = std::make_unique(yylhs.location, ast::stmt(std::move(yystack_[6].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[4].value.as < ast::expr > ()), ast::stmt(std::move(yystack_[2].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2452 "parser.cpp" break; case 80: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 460 "parser.ypp" +#line 464 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2458 "parser.cpp" break; case 81: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 462 "parser.ypp" +#line 466 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[6].value.as < ast::expr_identifier::ptr > ())), ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2464 "parser.cpp" break; case 82: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 467 "parser.ypp" +#line 471 "parser.ypp" { yylhs.value.as < ast::stmt_switch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2470 "parser.cpp" break; case 83: // stmt_case: "case" expr_integer ":" -#line 472 "parser.ypp" +#line 476 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_integer::ptr > ())), std::make_unique(yylhs.location)); } #line 2476 "parser.cpp" break; case 84: // stmt_case: "case" expr_string ":" -#line 474 "parser.ypp" +#line 478 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_string::ptr > ())), std::make_unique(yylhs.location)); } #line 2482 "parser.cpp" break; case 85: // stmt_default: "default" ":" -#line 479 "parser.ypp" +#line 483 "parser.ypp" { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2488 "parser.cpp" break; case 86: // stmt_break: "break" ";" -#line 484 "parser.ypp" +#line 488 "parser.ypp" { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } #line 2494 "parser.cpp" break; case 87: // stmt_continue: "continue" ";" -#line 489 "parser.ypp" +#line 493 "parser.ypp" { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } #line 2500 "parser.cpp" break; case 88: // stmt_return: "return" expr ";" -#line 494 "parser.ypp" +#line 498 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2506 "parser.cpp" break; case 89: // stmt_return: "return" ";" -#line 496 "parser.ypp" +#line 500 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2512 "parser.cpp" break; case 90: // stmt_breakpoint: "breakpoint" ";" -#line 501 "parser.ypp" +#line 505 "parser.ypp" { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } #line 2518 "parser.cpp" break; case 91: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 506 "parser.ypp" +#line 510 "parser.ypp" { yylhs.value.as < ast::stmt_prof_begin::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2524 "parser.cpp" break; case 92: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 511 "parser.ypp" +#line 515 "parser.ypp" { yylhs.value.as < ast::stmt_prof_end::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2530 "parser.cpp" break; case 93: // expr: expr_ternary -#line 515 "parser.ypp" +#line 519 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2536 "parser.cpp" break; case 94: // expr: expr_binary -#line 516 "parser.ypp" +#line 520 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2542 "parser.cpp" break; case 95: // expr: expr_primitive -#line 517 "parser.ypp" +#line 521 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2548 "parser.cpp" break; case 96: // expr_or_empty: expr -#line 521 "parser.ypp" +#line 525 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2554 "parser.cpp" break; case 97: // expr_or_empty: %empty -#line 522 "parser.ypp" +#line 526 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } #line 2560 "parser.cpp" break; case 98: // expr_assign: expr_object "=" expr -#line 527 "parser.ypp" +#line 531 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2566 "parser.cpp" break; case 99: // expr_assign: expr_object "|=" expr -#line 529 "parser.ypp" +#line 533 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2572 "parser.cpp" break; case 100: // expr_assign: expr_object "&=" expr -#line 531 "parser.ypp" +#line 535 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2578 "parser.cpp" break; case 101: // expr_assign: expr_object "^=" expr -#line 533 "parser.ypp" +#line 537 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2584 "parser.cpp" break; case 102: // expr_assign: expr_object "<<=" expr -#line 535 "parser.ypp" +#line 539 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()),std::move( yystack_[0].value.as < ast::expr > ())); } #line 2590 "parser.cpp" break; case 103: // expr_assign: expr_object ">>=" expr -#line 537 "parser.ypp" +#line 541 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2596 "parser.cpp" break; case 104: // expr_assign: expr_object "+=" expr -#line 539 "parser.ypp" +#line 543 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2602 "parser.cpp" break; case 105: // expr_assign: expr_object "-=" expr -#line 541 "parser.ypp" +#line 545 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2608 "parser.cpp" break; case 106: // expr_assign: expr_object "*=" expr -#line 543 "parser.ypp" +#line 547 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2614 "parser.cpp" break; case 107: // expr_assign: expr_object "/=" expr -#line 545 "parser.ypp" +#line 549 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2620 "parser.cpp" break; case 108: // expr_assign: expr_object "%=" expr -#line 547 "parser.ypp" +#line 551 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2626 "parser.cpp" break; case 109: // expr_increment: "++" expr_object -#line 552 "parser.ypp" +#line 556 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2632 "parser.cpp" break; case 110: // expr_increment: expr_object "++" -#line 554 "parser.ypp" +#line 558 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2638 "parser.cpp" break; case 111: // expr_decrement: "--" expr_object -#line 559 "parser.ypp" +#line 563 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2644 "parser.cpp" break; case 112: // expr_decrement: expr_object "--" -#line 561 "parser.ypp" +#line 565 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2650 "parser.cpp" break; case 113: // expr_ternary: expr "?" expr ":" expr -#line 566 "parser.ypp" +#line 570 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2656 "parser.cpp" break; case 114: // expr_binary: expr "||" expr -#line 571 "parser.ypp" +#line 575 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2662 "parser.cpp" break; case 115: // expr_binary: expr "&&" expr -#line 573 "parser.ypp" +#line 577 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2668 "parser.cpp" break; case 116: // expr_binary: expr "==" expr -#line 575 "parser.ypp" +#line 579 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2674 "parser.cpp" break; case 117: // expr_binary: expr "!=" expr -#line 577 "parser.ypp" +#line 581 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2680 "parser.cpp" break; case 118: // expr_binary: expr "<=" expr -#line 579 "parser.ypp" +#line 583 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2686 "parser.cpp" break; case 119: // expr_binary: expr ">=" expr -#line 581 "parser.ypp" +#line 585 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2692 "parser.cpp" break; case 120: // expr_binary: expr "<" expr -#line 583 "parser.ypp" +#line 587 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2698 "parser.cpp" break; case 121: // expr_binary: expr ">" expr -#line 585 "parser.ypp" +#line 589 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2704 "parser.cpp" break; case 122: // expr_binary: expr "|" expr -#line 587 "parser.ypp" +#line 591 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2710 "parser.cpp" break; case 123: // expr_binary: expr "&" expr -#line 589 "parser.ypp" +#line 593 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2716 "parser.cpp" break; case 124: // expr_binary: expr "^" expr -#line 591 "parser.ypp" +#line 595 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2722 "parser.cpp" break; case 125: // expr_binary: expr "<<" expr -#line 593 "parser.ypp" +#line 597 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2728 "parser.cpp" break; case 126: // expr_binary: expr ">>" expr -#line 595 "parser.ypp" +#line 599 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2734 "parser.cpp" break; case 127: // expr_binary: expr "+" expr -#line 597 "parser.ypp" +#line 601 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2740 "parser.cpp" break; case 128: // expr_binary: expr "-" expr -#line 599 "parser.ypp" +#line 603 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2746 "parser.cpp" break; case 129: // expr_binary: expr "*" expr -#line 601 "parser.ypp" +#line 605 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2752 "parser.cpp" break; case 130: // expr_binary: expr "/" expr -#line 603 "parser.ypp" +#line 607 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2758 "parser.cpp" break; case 131: // expr_binary: expr "%" expr -#line 605 "parser.ypp" +#line 609 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2764 "parser.cpp" break; case 132: // expr_primitive: expr_complement -#line 609 "parser.ypp" +#line 613 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } #line 2770 "parser.cpp" break; case 133: // expr_primitive: expr_not -#line 610 "parser.ypp" +#line 614 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } #line 2776 "parser.cpp" break; case 134: // expr_primitive: expr_call -#line 611 "parser.ypp" +#line 615 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 2782 "parser.cpp" break; case 135: // expr_primitive: expr_method -#line 612 "parser.ypp" +#line 616 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 2788 "parser.cpp" break; case 136: // expr_primitive: expr_add_array -#line 613 "parser.ypp" +#line 617 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } #line 2794 "parser.cpp" break; case 137: // expr_primitive: expr_reference -#line 614 "parser.ypp" +#line 618 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } #line 2800 "parser.cpp" break; case 138: // expr_primitive: expr_array -#line 615 "parser.ypp" +#line 619 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 2806 "parser.cpp" break; case 139: // expr_primitive: expr_field -#line 616 "parser.ypp" +#line 620 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 2812 "parser.cpp" break; case 140: // expr_primitive: expr_size -#line 617 "parser.ypp" +#line 621 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } #line 2818 "parser.cpp" break; case 141: // expr_primitive: expr_paren -#line 618 "parser.ypp" +#line 622 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } #line 2824 "parser.cpp" break; case 142: // expr_primitive: expr_thisthread -#line 619 "parser.ypp" +#line 623 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } #line 2830 "parser.cpp" break; case 143: // expr_primitive: expr_empty_array -#line 620 "parser.ypp" +#line 624 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } #line 2836 "parser.cpp" break; case 144: // expr_primitive: expr_undefined -#line 621 "parser.ypp" +#line 625 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } #line 2842 "parser.cpp" break; case 145: // expr_primitive: expr_game -#line 622 "parser.ypp" +#line 626 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 2848 "parser.cpp" break; case 146: // expr_primitive: expr_self -#line 623 "parser.ypp" +#line 627 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 2854 "parser.cpp" break; case 147: // expr_primitive: expr_anim -#line 624 "parser.ypp" +#line 628 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 2860 "parser.cpp" break; case 148: // expr_primitive: expr_level -#line 625 "parser.ypp" +#line 629 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 2866 "parser.cpp" break; case 149: // expr_primitive: expr_animation -#line 626 "parser.ypp" +#line 630 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } #line 2872 "parser.cpp" break; case 150: // expr_primitive: expr_animtree -#line 627 "parser.ypp" +#line 631 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } #line 2878 "parser.cpp" break; case 151: // expr_primitive: expr_identifier -#line 628 "parser.ypp" +#line 632 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 2884 "parser.cpp" break; case 152: // expr_primitive: expr_istring -#line 629 "parser.ypp" +#line 633 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } #line 2890 "parser.cpp" break; case 153: // expr_primitive: expr_string -#line 630 "parser.ypp" +#line 634 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } #line 2896 "parser.cpp" break; case 154: // expr_primitive: expr_vector -#line 631 "parser.ypp" +#line 635 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } #line 2902 "parser.cpp" break; case 155: // expr_primitive: expr_float -#line 632 "parser.ypp" +#line 636 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } #line 2908 "parser.cpp" break; case 156: // expr_primitive: expr_integer -#line 633 "parser.ypp" +#line 637 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } #line 2914 "parser.cpp" break; case 157: // expr_primitive: expr_false -#line 634 "parser.ypp" +#line 638 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } #line 2920 "parser.cpp" break; case 158: // expr_primitive: expr_true -#line 635 "parser.ypp" +#line 639 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } #line 2926 "parser.cpp" break; case 159: // expr_complement: "~" expr -#line 640 "parser.ypp" +#line 644 "parser.ypp" { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2932 "parser.cpp" break; case 160: // expr_not: "!" expr -#line 645 "parser.ypp" +#line 649 "parser.ypp" { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2938 "parser.cpp" break; case 161: // expr_call: expr_function -#line 649 "parser.ypp" +#line 653 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2944 "parser.cpp" break; case 162: // expr_call: expr_pointer -#line 650 "parser.ypp" +#line 654 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2950 "parser.cpp" break; case 163: // expr_method: expr_object expr_function -#line 653 "parser.ypp" +#line 657 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 2956 "parser.cpp" break; case 164: // expr_method: expr_object expr_pointer -#line 654 "parser.ypp" +#line 658 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 2962 "parser.cpp" break; case 165: // expr_function: expr_identifier "(" expr_arguments ")" -#line 659 "parser.ypp" +#line 663 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2968 "parser.cpp" break; case 166: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 661 "parser.ypp" +#line 665 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 2974 "parser.cpp" break; case 167: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 663 "parser.ypp" +#line 667 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2980 "parser.cpp" break; case 168: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 665 "parser.ypp" +#line 669 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 2986 "parser.cpp" break; case 169: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 667 "parser.ypp" +#line 671 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2992 "parser.cpp" break; case 170: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 669 "parser.ypp" +#line 673 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 2998 "parser.cpp" break; case 171: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 674 "parser.ypp" +#line 678 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3004 "parser.cpp" break; case 172: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 676 "parser.ypp" +#line 680 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3010 "parser.cpp" break; case 173: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 678 "parser.ypp" +#line 682 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 3016 "parser.cpp" break; case 174: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 680 "parser.ypp" +#line 684 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::builtin); } #line 3022 "parser.cpp" break; case 175: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 685 "parser.ypp" +#line 689 "parser.ypp" { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } #line 3028 "parser.cpp" break; case 176: // expr_parameters: expr_parameters "," expr_identifier -#line 690 "parser.ypp" +#line 694 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3034 "parser.cpp" break; case 177: // expr_parameters: expr_identifier -#line 692 "parser.ypp" +#line 696 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3040 "parser.cpp" break; case 178: // expr_parameters: %empty -#line 694 "parser.ypp" +#line 698 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } #line 3046 "parser.cpp" break; case 179: // expr_arguments: expr_arguments_no_empty -#line 699 "parser.ypp" +#line 703 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } #line 3052 "parser.cpp" break; case 180: // expr_arguments: %empty -#line 701 "parser.ypp" +#line 705 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } #line 3058 "parser.cpp" break; case 181: // expr_arguments_no_empty: expr_arguments "," expr -#line 706 "parser.ypp" +#line 710 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ()); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3064 "parser.cpp" break; case 182: // expr_arguments_no_empty: expr -#line 708 "parser.ypp" +#line 712 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3070 "parser.cpp" break; case 183: // expr_reference: "::" expr_identifier -#line 713 "parser.ypp" +#line 717 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3076 "parser.cpp" break; case 184: // expr_reference: expr_path "::" expr_identifier -#line 715 "parser.ypp" +#line 719 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_path::ptr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3082 "parser.cpp" break; case 185: // expr_array: expr_object "[" expr "]" -#line 720 "parser.ypp" +#line 724 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3088 "parser.cpp" break; case 186: // expr_field: expr_object "." expr_identifier_nosize -#line 725 "parser.ypp" +#line 729 "parser.ypp" { yylhs.value.as < ast::expr_field::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3094 "parser.cpp" break; case 187: // expr_size: expr_object "." "size" -#line 730 "parser.ypp" +#line 734 "parser.ypp" { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } #line 3100 "parser.cpp" break; case 188: // expr_paren: "(" expr ")" -#line 735 "parser.ypp" +#line 739 "parser.ypp" { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3106 "parser.cpp" break; case 189: // expr_object: expr_call -#line 739 "parser.ypp" +#line 743 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 3112 "parser.cpp" break; case 190: // expr_object: expr_method -#line 740 "parser.ypp" +#line 744 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 3118 "parser.cpp" break; case 191: // expr_object: expr_array -#line 741 "parser.ypp" +#line 745 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 3124 "parser.cpp" break; case 192: // expr_object: expr_field -#line 742 "parser.ypp" +#line 746 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 3130 "parser.cpp" break; case 193: // expr_object: expr_game -#line 743 "parser.ypp" +#line 747 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 3136 "parser.cpp" break; case 194: // expr_object: expr_self -#line 744 "parser.ypp" +#line 748 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 3142 "parser.cpp" break; case 195: // expr_object: expr_anim -#line 745 "parser.ypp" +#line 749 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 3148 "parser.cpp" break; case 196: // expr_object: expr_level -#line 746 "parser.ypp" +#line 750 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 3154 "parser.cpp" break; case 197: // expr_object: expr_identifier -#line 747 "parser.ypp" +#line 751 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 3160 "parser.cpp" break; case 198: // expr_thisthread: "thisthread" -#line 752 "parser.ypp" +#line 756 "parser.ypp" { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } #line 3166 "parser.cpp" break; case 199: // expr_empty_array: "[" "]" -#line 757 "parser.ypp" +#line 761 "parser.ypp" { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } #line 3172 "parser.cpp" break; case 200: // expr_undefined: "undefined" -#line 762 "parser.ypp" +#line 766 "parser.ypp" { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } #line 3178 "parser.cpp" break; case 201: // expr_game: "game" -#line 767 "parser.ypp" +#line 771 "parser.ypp" { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } #line 3184 "parser.cpp" break; case 202: // expr_self: "self" -#line 772 "parser.ypp" +#line 776 "parser.ypp" { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } #line 3190 "parser.cpp" break; case 203: // expr_anim: "anim" -#line 777 "parser.ypp" +#line 781 "parser.ypp" { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } #line 3196 "parser.cpp" break; case 204: // expr_level: "level" -#line 782 "parser.ypp" +#line 786 "parser.ypp" { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } #line 3202 "parser.cpp" break; case 205: // expr_animation: "%" "identifier" -#line 787 "parser.ypp" +#line 791 "parser.ypp" { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3208 "parser.cpp" break; case 206: // expr_animtree: "#animtree" -#line 792 "parser.ypp" +#line 796 "parser.ypp" { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } #line 3214 "parser.cpp" break; case 207: // expr_identifier_nosize: "identifier" -#line 797 "parser.ypp" +#line 801 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3220 "parser.cpp" break; case 208: // expr_identifier: "identifier" -#line 802 "parser.ypp" +#line 806 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3226 "parser.cpp" break; case 209: // expr_identifier: "size" -#line 804 "parser.ypp" +#line 808 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } #line 3232 "parser.cpp" break; case 210: // expr_path: "identifier" -#line 809 "parser.ypp" +#line 813 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3238 "parser.cpp" break; case 211: // expr_path: "path" -#line 811 "parser.ypp" +#line 815 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3244 "parser.cpp" break; case 212: // expr_istring: "localized string" -#line 816 "parser.ypp" +#line 820 "parser.ypp" { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3250 "parser.cpp" break; case 213: // expr_string: "string literal" -#line 821 "parser.ypp" +#line 825 "parser.ypp" { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3256 "parser.cpp" break; case 214: // expr_vector: "(" expr "," expr "," expr ")" -#line 826 "parser.ypp" +#line 830 "parser.ypp" { yylhs.value.as < ast::expr_vector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3262 "parser.cpp" break; case 215: // expr_float: "-" "float" -#line 831 "parser.ypp" +#line 835 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3268 "parser.cpp" break; case 216: // expr_float: "float" -#line 833 "parser.ypp" +#line 837 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3274 "parser.cpp" break; case 217: // expr_integer: "-" "integer" -#line 838 "parser.ypp" +#line 842 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3280 "parser.cpp" break; case 218: // expr_integer: "integer" -#line 840 "parser.ypp" +#line 844 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3286 "parser.cpp" break; case 219: // expr_false: "false" -#line 845 "parser.ypp" +#line 849 "parser.ypp" { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } #line 3292 "parser.cpp" break; case 220: // expr_true: "true" -#line 850 "parser.ypp" +#line 854 "parser.ypp" { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } #line 3298 "parser.cpp" break; @@ -3562,6 +3562,8 @@ namespace xsk { namespace gsc { namespace s2 { } + + bool parser::yy_lac_check_ (symbol_kind_type yytoken) const { @@ -3666,7 +3668,9 @@ namespace xsk { namespace gsc { namespace s2 { follows. If no initial context is currently established for the current lookahead, then check if that lookahead can eventually be shifted if syntactic actions continue from the current context. */ - if (!yy_lac_established_) + if (yy_lac_established_) + return true; + else { #if S2DEBUG YYCDEBUG << "LAC: initial context established for " @@ -3675,12 +3679,11 @@ namespace xsk { namespace gsc { namespace s2 { yy_lac_established_ = true; return yy_lac_check_ (yytoken); } - return true; } // Discard any previous initial lookahead context. void - parser::yy_lac_discard_ (const char* evt) + parser::yy_lac_discard_ (const char* event) { /* Discard any previous initial lookahead context because of Event, which may be a lookahead change or an invalidation of the currently @@ -3696,11 +3699,12 @@ namespace xsk { namespace gsc { namespace s2 { if (yy_lac_established_) { YYCDEBUG << "LAC: initial context discarded due to " - << evt << '\n'; + << event << '\n'; yy_lac_established_ = false; } } + int parser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -4487,29 +4491,29 @@ namespace xsk { namespace gsc { namespace s2 { const short parser::yyrline_[] = { - 0, 255, 255, 256, 260, 262, 264, 266, 268, 270, - 275, 279, 284, 285, 286, 287, 288, 292, 297, 302, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 335, 336, 340, 342, 347, - 349, 354, 355, 359, 360, 364, 366, 368, 371, 375, - 377, 382, 384, 386, 391, 396, 398, 403, 408, 410, - 415, 417, 422, 427, 429, 434, 439, 444, 449, 454, - 459, 461, 466, 471, 473, 478, 483, 488, 493, 495, - 500, 505, 510, 515, 516, 517, 521, 522, 526, 528, - 530, 532, 534, 536, 538, 540, 542, 544, 546, 551, - 553, 558, 560, 565, 570, 572, 574, 576, 578, 580, - 582, 584, 586, 588, 590, 592, 594, 596, 598, 600, - 602, 604, 609, 610, 611, 612, 613, 614, 615, 616, - 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 639, - 644, 649, 650, 653, 654, 658, 660, 662, 664, 666, - 668, 673, 675, 677, 679, 684, 689, 691, 694, 698, - 701, 705, 707, 712, 714, 719, 724, 729, 734, 739, - 740, 741, 742, 743, 744, 745, 746, 747, 751, 756, - 761, 766, 771, 776, 781, 786, 791, 796, 801, 803, - 808, 810, 815, 820, 825, 830, 832, 837, 839, 844, - 849 + 0, 259, 259, 260, 264, 266, 268, 270, 272, 274, + 279, 283, 288, 289, 290, 291, 292, 296, 301, 306, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 339, 340, 344, 346, 351, + 353, 358, 359, 363, 364, 368, 370, 372, 375, 379, + 381, 386, 388, 390, 395, 400, 402, 407, 412, 414, + 419, 421, 426, 431, 433, 438, 443, 448, 453, 458, + 463, 465, 470, 475, 477, 482, 487, 492, 497, 499, + 504, 509, 514, 519, 520, 521, 525, 526, 530, 532, + 534, 536, 538, 540, 542, 544, 546, 548, 550, 555, + 557, 562, 564, 569, 574, 576, 578, 580, 582, 584, + 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, + 606, 608, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 643, + 648, 653, 654, 657, 658, 662, 664, 666, 668, 670, + 672, 677, 679, 681, 683, 688, 693, 695, 698, 702, + 705, 709, 711, 716, 718, 723, 728, 733, 738, 743, + 744, 745, 746, 747, 748, 749, 750, 751, 755, 760, + 765, 770, 775, 780, 785, 790, 795, 800, 805, 807, + 812, 814, 819, 824, 829, 834, 836, 841, 843, 848, + 853 }; void @@ -4542,9 +4546,9 @@ namespace xsk { namespace gsc { namespace s2 { #line 13 "parser.ypp" } } } // xsk::gsc::s2 -#line 4546 "parser.cpp" +#line 4550 "parser.cpp" -#line 853 "parser.ypp" +#line 857 "parser.ypp" void xsk::gsc::s2::parser::error(const xsk::gsc::location& loc, const std::string& msg) diff --git a/src/s2/xsk/parser.hpp b/src/s2/xsk/parser.hpp index 66b75715..32fc4e73 100644 --- a/src/s2/xsk/parser.hpp +++ b/src/s2/xsk/parser.hpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -47,10 +47,14 @@ // "%code requires" blocks. #line 28 "parser.ypp" +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "s2.hpp" namespace xsk::gsc::s2 { class lexer; } -#line 54 "parser.hpp" +#line 58 "parser.hpp" # include # include // std::abort @@ -126,12 +130,18 @@ namespace xsk::gsc::s2 { class lexer; } # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -193,7 +203,7 @@ namespace xsk::gsc::s2 { class lexer; } #line 13 "parser.ypp" namespace xsk { namespace gsc { namespace s2 { -#line 197 "parser.hpp" +#line 207 "parser.hpp" @@ -202,27 +212,32 @@ namespace xsk { namespace gsc { namespace s2 { class parser { public: -#ifndef S2STYPE +#ifdef S2STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define S2STYPE in C++, use %define api.value.type" +# endif + typedef S2STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { S2_ASSERT (sizeof (T) <= size); @@ -231,13 +246,13 @@ namespace xsk { namespace gsc { namespace s2 { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { S2_ASSERT (!yytypeid_); } @@ -381,7 +396,7 @@ namespace xsk { namespace gsc { namespace s2 { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -391,7 +406,7 @@ namespace xsk { namespace gsc { namespace s2 { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -400,7 +415,7 @@ namespace xsk { namespace gsc { namespace s2 { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -635,18 +650,19 @@ namespace xsk { namespace gsc { namespace s2 { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef S2STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef xsk::gsc::location location_type; @@ -793,7 +809,7 @@ namespace xsk { namespace gsc { namespace s2 { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -1023,7 +1039,7 @@ namespace xsk { namespace gsc { namespace s2 { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -2291,6 +2307,8 @@ namespace xsk { namespace gsc { namespace s2 { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -2617,7 +2635,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -2632,22 +2650,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { - /// Default constructor. - by_kind (); - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that); -#endif - - /// Copy constructor. - by_kind (const by_kind& that); - /// The symbol kind as needed by the constructor. typedef token_kind_type kind_type; + /// Default constructor. + by_kind () YY_NOEXCEPT; + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that) YY_NOEXCEPT; +#endif + + /// Copy constructor. + by_kind (const by_kind& that) YY_NOEXCEPT; + /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -2677,30 +2697,34 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ S2_ASSERT (tok == token::S2EOF || (token::S2error <= tok && tok <= token::MOD) || (token::SIZEOF <= tok && tok <= token::POSTDEC)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ S2_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); +#endif } }; @@ -2749,7 +2773,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static const char *symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -4501,19 +4525,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const short yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; @@ -4540,14 +4564,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const unsigned char yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const unsigned char yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -4646,7 +4670,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -4725,7 +4749,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -4784,7 +4808,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -4803,7 +4827,7 @@ switch (yykind) inline parser::symbol_kind_type - parser::yytranslate_ (int t) + parser::yytranslate_ (int t) YY_NOEXCEPT { return static_cast (t); } @@ -5112,6 +5136,7 @@ switch (yykind) + template parser::symbol_kind_type parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -5119,6 +5144,7 @@ switch (yykind) return this->kind (); } + template bool parser::basic_symbol::empty () const YY_NOEXCEPT @@ -5429,13 +5455,13 @@ switch (yykind) // by_kind. inline - parser::by_kind::by_kind () + parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - parser::by_kind::by_kind (by_kind&& that) + parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -5443,15 +5469,17 @@ switch (yykind) #endif inline - parser::by_kind::by_kind (const by_kind& that) + parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - parser::by_kind::by_kind (token_kind_type t) + parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void parser::by_kind::clear () YY_NOEXCEPT @@ -5474,6 +5502,7 @@ switch (yykind) return kind_; } + inline parser::symbol_kind_type parser::by_kind::type_get () const YY_NOEXCEPT @@ -5481,9 +5510,10 @@ switch (yykind) return this->kind (); } + #line 13 "parser.ypp" } } } // xsk::gsc::s2 -#line 5487 "parser.hpp" +#line 5517 "parser.hpp" diff --git a/src/s2/xsk/resolver.cpp b/src/s2/xsk/resolver.cpp index 6921d668..ca29aa50 100644 --- a/src/s2/xsk/resolver.cpp +++ b/src/s2/xsk/resolver.cpp @@ -6,6 +6,11 @@ #include "stdafx.hpp" #include "s2.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4244) +#endif + namespace xsk::gsc::s2 { @@ -61,7 +66,7 @@ auto resolver::function_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_func_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = function_map_rev.find(name); @@ -90,7 +95,7 @@ auto resolver::method_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_meth_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = method_map_rev.find(name); @@ -119,7 +124,7 @@ auto resolver::file_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = file_map_rev.find(name); @@ -148,7 +153,7 @@ auto resolver::token_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = token_map_rev.find(name); @@ -212,7 +217,7 @@ auto resolver::make_token(std::string_view str) -> std::string for (std::size_t i = 0; i < data.size(); i++) { - data[i] = std::tolower(str[i]); + data[i] = static_cast(std::tolower(static_cast(str[i]))); if (data[i] == '\\') data[i] = '/'; } @@ -3200,3 +3205,7 @@ struct __init__ __init__ _; } // namespace xsk::gsc::s2 + +#ifdef _MSC_VER +#pragma warning(pop) +#endif diff --git a/src/s4/stdafx.hpp b/src/s4/stdafx.hpp index b6d0451e..19f22f43 100644 --- a/src/s4/stdafx.hpp +++ b/src/s4/stdafx.hpp @@ -5,38 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4005) -#pragma warning(disable:4018) -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4389) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include -// Ext using namespace std::literals; - -#include "xsk/s4.hpp" diff --git a/src/s4/xsk/assembler.cpp b/src/s4/xsk/assembler.cpp index f1213cba..3dca469f 100644 --- a/src/s4/xsk/assembler.cpp +++ b/src/s4/xsk/assembler.cpp @@ -507,7 +507,7 @@ void assembler::assemble_end_switch(const instruction::ptr& inst) const auto count = std::stoul(inst->data[0]); - script_->write(count); + script_->write(static_cast(count)); std::uint32_t index = inst->index + 3; @@ -588,15 +588,15 @@ void assembler::assemble_jump(const instruction::ptr& inst, bool expr, bool back if (expr) { - script_->write(addr - inst->index - 3); + script_->write(static_cast(addr - inst->index - 3)); } else if (back) { - script_->write((inst->index + 3) - addr); + script_->write(static_cast((inst->index + 3) - addr)); } else { - script_->write(addr - inst->index - 5); + script_->write(static_cast(addr - inst->index - 5)); } } @@ -615,11 +615,11 @@ void assembler::assemble_offset(std::int32_t offset) auto assembler::resolve_function(const std::string& name) -> std::int32_t { - for (const auto& func : functions_) + for (const auto& entry : functions_) { - if (func->name == name) + if (entry->name == name) { - return func->index; + return entry->index; } } @@ -628,11 +628,11 @@ auto assembler::resolve_function(const std::string& name) -> std::int32_t auto assembler::resolve_label(const std::string& name) -> std::int32_t { - for (const auto& func : labels_) + for (const auto& entry : labels_) { - if (func.second == name) + if (entry.second == name) { - return func.first; + return entry.first; } } diff --git a/src/s4/xsk/compiler.cpp b/src/s4/xsk/compiler.cpp index 54f78452..02435d60 100644 --- a/src/s4/xsk/compiler.cpp +++ b/src/s4/xsk/compiler.cpp @@ -848,7 +848,7 @@ void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt, const block:: emit_opcode(opcode::OP_endswitch, data); - auto offset = 7 * stmt->stmt->list.size(); + auto offset = static_cast(7 * stmt->stmt->list.size()); function_->instructions.back()->size += offset; index_ += offset; @@ -1552,7 +1552,7 @@ void compiler::emit_expr_add_array(const ast::expr_add_array::ptr& expr, const b void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr, const block::ptr& blk) { - auto num = expr->list.size(); + auto num = static_cast(expr->list.size()); if (num) { @@ -2720,7 +2720,7 @@ auto compiler::variable_stack_index(const ast::expr_identifier::ptr& name, const { if (blk->local_vars.at(i).init) { - return blk->local_vars_create_count - 1 - i; + return static_cast(blk->local_vars_create_count - 1 - i); } throw comp_error(name->loc(), "local variable '" + name->value + "' not initialized."); diff --git a/src/s4/xsk/decompiler.cpp b/src/s4/xsk/decompiler.cpp index 2c7f7868..aba03579 100644 --- a/src/s4/xsk/decompiler.cpp +++ b/src/s4/xsk/decompiler.cpp @@ -1818,7 +1818,7 @@ void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) void decompiler::decompile_infinites(const ast::stmt_list::ptr& stmt) { - for (int i = stmt->list.size() - 1; i >= 0; i--) + for (auto i = stmt->list.size() - 1; i > 0; i--) { if (stmt->list.at(i) == ast::kind::asm_jump_back) { @@ -1981,7 +1981,7 @@ void decompiler::decompile_aborts(const ast::stmt_list::ptr& block) } } -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_end = stmt->list.at(begin).as_cond->value; @@ -2009,7 +2009,7 @@ void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t beg stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.loc_end = stmt->list.at(end).loc().label(); @@ -2060,7 +2060,7 @@ void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.is_last = true; @@ -2120,7 +2120,7 @@ void decompiler::decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uin } } -void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); @@ -2150,7 +2150,7 @@ void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32 stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t start, std::uint32_t end) +void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::size_t start, std::size_t end) { auto& last = block->list.at(end - 1); @@ -2215,7 +2215,7 @@ void decompiler::decompile_loop(const ast::stmt_list::ptr& block, std::uint32_t decompile_while(block, start, end); } -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2245,7 +2245,7 @@ void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2276,7 +2276,7 @@ void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2330,7 +2330,7 @@ void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t be stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -2397,7 +2397,7 @@ void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t start) +void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) { block blk; blk.loc_continue = blocks_.back().loc_continue; @@ -2510,7 +2510,7 @@ void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); } -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool +auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool { for (auto i = begin; i < end; i++) { @@ -2529,7 +2529,7 @@ auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::u return false; } -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t +auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t { auto index = 0u; @@ -2547,7 +2547,7 @@ auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std: throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); } -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool +auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool { if (index == stmt->list.size() - 1) return true; @@ -3371,7 +3371,7 @@ void decompiler::process_var_access(ast::expr& expr, const block::ptr& blk) void decompiler::process_var_remove(const ast::asm_remove::ptr& expr, const block::ptr& blk) { - blk->local_vars_public_count = blk->local_vars.size() - std::stoi(expr->index); + blk->local_vars_public_count = static_cast(blk->local_vars.size() - std::stoi(expr->index)); } } // namespace xsk::gsc::s4 diff --git a/src/s4/xsk/decompiler.hpp b/src/s4/xsk/decompiler.hpp index aa4b3743..3bdd91b8 100644 --- a/src/s4/xsk/decompiler.hpp +++ b/src/s4/xsk/decompiler.hpp @@ -34,19 +34,19 @@ private: void decompile_switches(const ast::stmt_list::ptr& stmt); void decompile_ifelses(const ast::stmt_list::ptr& stmt); void decompile_aborts(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool; + void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_last_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); + auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; + auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; + auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; void process_stack(const ast::decl_thread::ptr& thread); void process_parameters(const ast::expr_parameters::ptr& params, const block::ptr& blk); void process_stmt(const ast::stmt& stmt, const block::ptr& blk); diff --git a/src/s4/xsk/lexer.cpp b/src/s4/xsk/lexer.cpp index f5cb17cb..8a2e03c2 100644 --- a/src/s4/xsk/lexer.cpp +++ b/src/s4/xsk/lexer.cpp @@ -99,7 +99,7 @@ void reader::init(const char* data, size_t size) { state = reader::ok; buffer_pos = data; - bytes_remaining = size; + bytes_remaining = static_cast(size); last_byte = 0; current_byte = *data; } diff --git a/src/s4/xsk/parser.cpp b/src/s4/xsk/parser.cpp index dd2397e7..12ff50bc 100644 --- a/src/s4/xsk/parser.cpp +++ b/src/s4/xsk/parser.cpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -35,7 +35,7 @@ // private implementation details that can be changed or removed. // "%code top" blocks. -#line 34 "parser.ypp" +#line 38 "parser.ypp" #include "stdafx.hpp" #include "parser.hpp" @@ -166,9 +166,9 @@ namespace xsk { namespace gsc { namespace s4 { parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -1499,7 +1499,7 @@ namespace xsk { namespace gsc { namespace s4 { } void - parser::yypop_ (int n) + parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -1542,13 +1542,13 @@ namespace xsk { namespace gsc { namespace s4 { } bool - parser::yy_pact_value_is_default_ (int yyvalue) + parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - parser::yy_table_value_is_error_ (int yyvalue) + parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -1579,8 +1579,8 @@ namespace xsk { namespace gsc { namespace s4 { /// The return value of parse (). int yyresult; - /// Discard the LAC context in case there still is one left from a - /// previous invocation. + // Discard the LAC context in case there still is one left from a + // previous invocation. yy_lac_discard_ ("init"); #if YY_EXCEPTIONS @@ -1658,7 +1658,7 @@ namespace xsk { namespace gsc { namespace s4 { if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) { if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; goto yydefault; } @@ -1669,7 +1669,7 @@ namespace xsk { namespace gsc { namespace s4 { if (yy_table_value_is_error_ (yyn)) goto yyerrlab; if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -2024,1339 +2024,1339 @@ namespace xsk { namespace gsc { namespace s4 { switch (yyn) { case 2: // root: program -#line 259 "parser.ypp" +#line 263 "parser.ypp" { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } #line 2030 "parser.cpp" break; case 3: // root: %empty -#line 260 "parser.ypp" +#line 264 "parser.ypp" { ast = std::make_unique(yylhs.location); } #line 2036 "parser.cpp" break; case 4: // program: program inline -#line 265 "parser.ypp" +#line 269 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } #line 2042 "parser.cpp" break; case 5: // program: program include -#line 267 "parser.ypp" +#line 271 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2048 "parser.cpp" break; case 6: // program: program declaration -#line 269 "parser.ypp" +#line 273 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2054 "parser.cpp" break; case 7: // program: inline -#line 271 "parser.ypp" +#line 275 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } #line 2060 "parser.cpp" break; case 8: // program: include -#line 273 "parser.ypp" +#line 277 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2066 "parser.cpp" break; case 9: // program: declaration -#line 275 "parser.ypp" +#line 279 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2072 "parser.cpp" break; case 10: // inline: "#inline" expr_path ";" -#line 279 "parser.ypp" +#line 283 "parser.ypp" { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } #line 2078 "parser.cpp" break; case 11: // include: "#include" expr_path ";" -#line 284 "parser.ypp" +#line 288 "parser.ypp" { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } #line 2084 "parser.cpp" break; case 12: // declaration: "/#" -#line 288 "parser.ypp" +#line 292 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } #line 2090 "parser.cpp" break; case 13: // declaration: "#/" -#line 289 "parser.ypp" +#line 293 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } #line 2096 "parser.cpp" break; case 14: // declaration: decl_usingtree -#line 290 "parser.ypp" +#line 294 "parser.ypp" { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } #line 2102 "parser.cpp" break; case 15: // declaration: decl_constant -#line 291 "parser.ypp" +#line 295 "parser.ypp" { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } #line 2108 "parser.cpp" break; case 16: // declaration: decl_thread -#line 292 "parser.ypp" +#line 296 "parser.ypp" { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } #line 2114 "parser.cpp" break; case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 297 "parser.ypp" +#line 301 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_usingtree::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_string::ptr > ())); } #line 2120 "parser.cpp" break; case 18: // decl_constant: expr_identifier "=" expr ";" -#line 302 "parser.ypp" +#line 306 "parser.ypp" { yylhs.value.as < ast::decl_constant::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 2126 "parser.cpp" break; case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 307 "parser.ypp" +#line 311 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2132 "parser.cpp" break; case 20: // stmt: stmt_block -#line 311 "parser.ypp" +#line 315 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } #line 2138 "parser.cpp" break; case 21: // stmt: stmt_call -#line 312 "parser.ypp" +#line 316 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } #line 2144 "parser.cpp" break; case 22: // stmt: stmt_assign -#line 313 "parser.ypp" +#line 317 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } #line 2150 "parser.cpp" break; case 23: // stmt: stmt_endon -#line 314 "parser.ypp" +#line 318 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } #line 2156 "parser.cpp" break; case 24: // stmt: stmt_notify -#line 315 "parser.ypp" +#line 319 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } #line 2162 "parser.cpp" break; case 25: // stmt: stmt_wait -#line 316 "parser.ypp" +#line 320 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } #line 2168 "parser.cpp" break; case 26: // stmt: stmt_waittill -#line 317 "parser.ypp" +#line 321 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } #line 2174 "parser.cpp" break; case 27: // stmt: stmt_waittillmatch -#line 318 "parser.ypp" +#line 322 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } #line 2180 "parser.cpp" break; case 28: // stmt: stmt_waittillframeend -#line 319 "parser.ypp" +#line 323 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } #line 2186 "parser.cpp" break; case 29: // stmt: stmt_waitframe -#line 320 "parser.ypp" +#line 324 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waitframe = std::move(yystack_[0].value.as < ast::stmt_waitframe::ptr > ()); } #line 2192 "parser.cpp" break; case 30: // stmt: stmt_if -#line 321 "parser.ypp" +#line 325 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } #line 2198 "parser.cpp" break; case 31: // stmt: stmt_ifelse -#line 322 "parser.ypp" +#line 326 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } #line 2204 "parser.cpp" break; case 32: // stmt: stmt_while -#line 323 "parser.ypp" +#line 327 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } #line 2210 "parser.cpp" break; case 33: // stmt: stmt_dowhile -#line 324 "parser.ypp" +#line 328 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } #line 2216 "parser.cpp" break; case 34: // stmt: stmt_for -#line 325 "parser.ypp" +#line 329 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } #line 2222 "parser.cpp" break; case 35: // stmt: stmt_foreach -#line 326 "parser.ypp" +#line 330 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } #line 2228 "parser.cpp" break; case 36: // stmt: stmt_switch -#line 327 "parser.ypp" +#line 331 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } #line 2234 "parser.cpp" break; case 37: // stmt: stmt_case -#line 328 "parser.ypp" +#line 332 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } #line 2240 "parser.cpp" break; case 38: // stmt: stmt_default -#line 329 "parser.ypp" +#line 333 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } #line 2246 "parser.cpp" break; case 39: // stmt: stmt_break -#line 330 "parser.ypp" +#line 334 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } #line 2252 "parser.cpp" break; case 40: // stmt: stmt_continue -#line 331 "parser.ypp" +#line 335 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } #line 2258 "parser.cpp" break; case 41: // stmt: stmt_return -#line 332 "parser.ypp" +#line 336 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } #line 2264 "parser.cpp" break; case 42: // stmt: stmt_breakpoint -#line 333 "parser.ypp" +#line 337 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } #line 2270 "parser.cpp" break; case 43: // stmt: stmt_prof_begin -#line 334 "parser.ypp" +#line 338 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } #line 2276 "parser.cpp" break; case 44: // stmt: stmt_prof_end -#line 335 "parser.ypp" +#line 339 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } #line 2282 "parser.cpp" break; case 45: // stmt_or_dev: stmt -#line 339 "parser.ypp" +#line 343 "parser.ypp" { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } #line 2288 "parser.cpp" break; case 46: // stmt_or_dev: stmt_dev -#line 340 "parser.ypp" +#line 344 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } #line 2294 "parser.cpp" break; case 47: // stmt_list: stmt_list stmt -#line 345 "parser.ypp" +#line 349 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2300 "parser.cpp" break; case 48: // stmt_list: stmt -#line 347 "parser.ypp" +#line 351 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2306 "parser.cpp" break; case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 352 "parser.ypp" +#line 356 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2312 "parser.cpp" break; case 50: // stmt_or_dev_list: stmt_or_dev -#line 354 "parser.ypp" +#line 358 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2318 "parser.cpp" break; case 51: // stmt_dev: "/#" stmt_list "#/" -#line 358 "parser.ypp" +#line 362 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::stmt_list::ptr > ())); } #line 2324 "parser.cpp" break; case 52: // stmt_dev: "/#" "#/" -#line 359 "parser.ypp" +#line 363 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2330 "parser.cpp" break; case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 363 "parser.ypp" +#line 367 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } #line 2336 "parser.cpp" break; case 54: // stmt_block: "{" "}" -#line 364 "parser.ypp" +#line 368 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } #line 2342 "parser.cpp" break; case 55: // stmt_expr: expr_assign -#line 369 "parser.ypp" +#line 373 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2348 "parser.cpp" break; case 56: // stmt_expr: expr_increment -#line 371 "parser.ypp" +#line 375 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2354 "parser.cpp" break; case 57: // stmt_expr: expr_decrement -#line 373 "parser.ypp" +#line 377 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2360 "parser.cpp" break; case 58: // stmt_expr: %empty -#line 375 "parser.ypp" +#line 379 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2366 "parser.cpp" break; case 59: // stmt_call: expr_call ";" -#line 380 "parser.ypp" +#line 384 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_call::ptr > ()))); } #line 2372 "parser.cpp" break; case 60: // stmt_call: expr_method ";" -#line 382 "parser.ypp" +#line 386 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_method::ptr > ()))); } #line 2378 "parser.cpp" break; case 61: // stmt_assign: expr_assign ";" -#line 387 "parser.ypp" +#line 391 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2384 "parser.cpp" break; case 62: // stmt_assign: expr_increment ";" -#line 389 "parser.ypp" +#line 393 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2390 "parser.cpp" break; case 63: // stmt_assign: expr_decrement ";" -#line 391 "parser.ypp" +#line 395 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2396 "parser.cpp" break; case 64: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 396 "parser.ypp" +#line 400 "parser.ypp" { yylhs.value.as < ast::stmt_endon::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ())); } #line 2402 "parser.cpp" break; case 65: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 401 "parser.ypp" +#line 405 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2408 "parser.cpp" break; case 66: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 403 "parser.ypp" +#line 407 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2414 "parser.cpp" break; case 67: // stmt_wait: "wait" expr ";" -#line 408 "parser.ypp" +#line 412 "parser.ypp" { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2420 "parser.cpp" break; case 68: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 413 "parser.ypp" +#line 417 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2426 "parser.cpp" break; case 69: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 415 "parser.ypp" +#line 419 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2432 "parser.cpp" break; case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 420 "parser.ypp" +#line 424 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2438 "parser.cpp" break; case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 422 "parser.ypp" +#line 426 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2444 "parser.cpp" break; case 72: // stmt_waittillframeend: "waittillframeend" ";" -#line 427 "parser.ypp" +#line 431 "parser.ypp" { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } #line 2450 "parser.cpp" break; case 73: // stmt_waitframe: "waitframe" ";" -#line 432 "parser.ypp" +#line 436 "parser.ypp" { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } #line 2456 "parser.cpp" break; case 74: // stmt_waitframe: "waitframe" "(" ")" ";" -#line 434 "parser.ypp" +#line 438 "parser.ypp" { yylhs.value.as < ast::stmt_waitframe::ptr > () = std::make_unique(yylhs.location); } #line 2462 "parser.cpp" break; case 75: // stmt_if: "if" "(" expr ")" stmt -#line 439 "parser.ypp" +#line 443 "parser.ypp" { yylhs.value.as < ast::stmt_if::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2468 "parser.cpp" break; case 76: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 444 "parser.ypp" +#line 448 "parser.ypp" { yylhs.value.as < ast::stmt_ifelse::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::stmt > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2474 "parser.cpp" break; case 77: // stmt_while: "while" "(" expr ")" stmt -#line 449 "parser.ypp" +#line 453 "parser.ypp" { yylhs.value.as < ast::stmt_while::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2480 "parser.cpp" break; case 78: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 454 "parser.ypp" +#line 458 "parser.ypp" { yylhs.value.as < ast::stmt_dowhile::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[5].value.as < ast::stmt > ())); } #line 2486 "parser.cpp" break; case 79: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 459 "parser.ypp" +#line 463 "parser.ypp" { yylhs.value.as < ast::stmt_for::ptr > () = std::make_unique(yylhs.location, ast::stmt(std::move(yystack_[6].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[4].value.as < ast::expr > ()), ast::stmt(std::move(yystack_[2].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2492 "parser.cpp" break; case 80: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 464 "parser.ypp" +#line 468 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2498 "parser.cpp" break; case 81: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 466 "parser.ypp" +#line 470 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[6].value.as < ast::expr_identifier::ptr > ())), ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2504 "parser.cpp" break; case 82: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 471 "parser.ypp" +#line 475 "parser.ypp" { yylhs.value.as < ast::stmt_switch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2510 "parser.cpp" break; case 83: // stmt_case: "case" expr_integer ":" -#line 476 "parser.ypp" +#line 480 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_integer::ptr > ())), std::make_unique(yylhs.location)); } #line 2516 "parser.cpp" break; case 84: // stmt_case: "case" expr_string ":" -#line 478 "parser.ypp" +#line 482 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_string::ptr > ())), std::make_unique(yylhs.location)); } #line 2522 "parser.cpp" break; case 85: // stmt_default: "default" ":" -#line 483 "parser.ypp" +#line 487 "parser.ypp" { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2528 "parser.cpp" break; case 86: // stmt_break: "break" ";" -#line 488 "parser.ypp" +#line 492 "parser.ypp" { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } #line 2534 "parser.cpp" break; case 87: // stmt_continue: "continue" ";" -#line 493 "parser.ypp" +#line 497 "parser.ypp" { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } #line 2540 "parser.cpp" break; case 88: // stmt_return: "return" expr ";" -#line 498 "parser.ypp" +#line 502 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2546 "parser.cpp" break; case 89: // stmt_return: "return" ";" -#line 500 "parser.ypp" +#line 504 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2552 "parser.cpp" break; case 90: // stmt_breakpoint: "breakpoint" ";" -#line 505 "parser.ypp" +#line 509 "parser.ypp" { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } #line 2558 "parser.cpp" break; case 91: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 510 "parser.ypp" +#line 514 "parser.ypp" { yylhs.value.as < ast::stmt_prof_begin::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2564 "parser.cpp" break; case 92: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 515 "parser.ypp" +#line 519 "parser.ypp" { yylhs.value.as < ast::stmt_prof_end::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2570 "parser.cpp" break; case 93: // expr: expr_ternary -#line 519 "parser.ypp" +#line 523 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2576 "parser.cpp" break; case 94: // expr: expr_binary -#line 520 "parser.ypp" +#line 524 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2582 "parser.cpp" break; case 95: // expr: expr_primitive -#line 521 "parser.ypp" +#line 525 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2588 "parser.cpp" break; case 96: // expr_or_empty: expr -#line 525 "parser.ypp" +#line 529 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2594 "parser.cpp" break; case 97: // expr_or_empty: %empty -#line 526 "parser.ypp" +#line 530 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } #line 2600 "parser.cpp" break; case 98: // expr_assign: expr_object "=" expr -#line 531 "parser.ypp" +#line 535 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2606 "parser.cpp" break; case 99: // expr_assign: expr_object "|=" expr -#line 533 "parser.ypp" +#line 537 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2612 "parser.cpp" break; case 100: // expr_assign: expr_object "&=" expr -#line 535 "parser.ypp" +#line 539 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2618 "parser.cpp" break; case 101: // expr_assign: expr_object "^=" expr -#line 537 "parser.ypp" +#line 541 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2624 "parser.cpp" break; case 102: // expr_assign: expr_object "<<=" expr -#line 539 "parser.ypp" +#line 543 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()),std::move( yystack_[0].value.as < ast::expr > ())); } #line 2630 "parser.cpp" break; case 103: // expr_assign: expr_object ">>=" expr -#line 541 "parser.ypp" +#line 545 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2636 "parser.cpp" break; case 104: // expr_assign: expr_object "+=" expr -#line 543 "parser.ypp" +#line 547 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2642 "parser.cpp" break; case 105: // expr_assign: expr_object "-=" expr -#line 545 "parser.ypp" +#line 549 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2648 "parser.cpp" break; case 106: // expr_assign: expr_object "*=" expr -#line 547 "parser.ypp" +#line 551 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2654 "parser.cpp" break; case 107: // expr_assign: expr_object "/=" expr -#line 549 "parser.ypp" +#line 553 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2660 "parser.cpp" break; case 108: // expr_assign: expr_object "%=" expr -#line 551 "parser.ypp" +#line 555 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2666 "parser.cpp" break; case 109: // expr_increment: "++" expr_object -#line 556 "parser.ypp" +#line 560 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2672 "parser.cpp" break; case 110: // expr_increment: expr_object "++" -#line 558 "parser.ypp" +#line 562 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2678 "parser.cpp" break; case 111: // expr_decrement: "--" expr_object -#line 563 "parser.ypp" +#line 567 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2684 "parser.cpp" break; case 112: // expr_decrement: expr_object "--" -#line 565 "parser.ypp" +#line 569 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2690 "parser.cpp" break; case 113: // expr_ternary: expr "?" expr ":" expr -#line 570 "parser.ypp" +#line 574 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2696 "parser.cpp" break; case 114: // expr_binary: expr "||" expr -#line 575 "parser.ypp" +#line 579 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2702 "parser.cpp" break; case 115: // expr_binary: expr "&&" expr -#line 577 "parser.ypp" +#line 581 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2708 "parser.cpp" break; case 116: // expr_binary: expr "==" expr -#line 579 "parser.ypp" +#line 583 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2714 "parser.cpp" break; case 117: // expr_binary: expr "!=" expr -#line 581 "parser.ypp" +#line 585 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2720 "parser.cpp" break; case 118: // expr_binary: expr "<=" expr -#line 583 "parser.ypp" +#line 587 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2726 "parser.cpp" break; case 119: // expr_binary: expr ">=" expr -#line 585 "parser.ypp" +#line 589 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2732 "parser.cpp" break; case 120: // expr_binary: expr "<" expr -#line 587 "parser.ypp" +#line 591 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2738 "parser.cpp" break; case 121: // expr_binary: expr ">" expr -#line 589 "parser.ypp" +#line 593 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2744 "parser.cpp" break; case 122: // expr_binary: expr "|" expr -#line 591 "parser.ypp" +#line 595 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2750 "parser.cpp" break; case 123: // expr_binary: expr "&" expr -#line 593 "parser.ypp" +#line 597 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2756 "parser.cpp" break; case 124: // expr_binary: expr "^" expr -#line 595 "parser.ypp" +#line 599 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2762 "parser.cpp" break; case 125: // expr_binary: expr "<<" expr -#line 597 "parser.ypp" +#line 601 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2768 "parser.cpp" break; case 126: // expr_binary: expr ">>" expr -#line 599 "parser.ypp" +#line 603 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2774 "parser.cpp" break; case 127: // expr_binary: expr "+" expr -#line 601 "parser.ypp" +#line 605 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2780 "parser.cpp" break; case 128: // expr_binary: expr "-" expr -#line 603 "parser.ypp" +#line 607 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2786 "parser.cpp" break; case 129: // expr_binary: expr "*" expr -#line 605 "parser.ypp" +#line 609 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2792 "parser.cpp" break; case 130: // expr_binary: expr "/" expr -#line 607 "parser.ypp" +#line 611 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2798 "parser.cpp" break; case 131: // expr_binary: expr "%" expr -#line 609 "parser.ypp" +#line 613 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2804 "parser.cpp" break; case 132: // expr_primitive: expr_complement -#line 613 "parser.ypp" +#line 617 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } #line 2810 "parser.cpp" break; case 133: // expr_primitive: expr_not -#line 614 "parser.ypp" +#line 618 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } #line 2816 "parser.cpp" break; case 134: // expr_primitive: expr_call -#line 615 "parser.ypp" +#line 619 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 2822 "parser.cpp" break; case 135: // expr_primitive: expr_method -#line 616 "parser.ypp" +#line 620 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 2828 "parser.cpp" break; case 136: // expr_primitive: expr_add_array -#line 617 "parser.ypp" +#line 621 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_add_array::ptr > ()); } #line 2834 "parser.cpp" break; case 137: // expr_primitive: expr_isdefined -#line 618 "parser.ypp" +#line 622 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_isdefined::ptr > ()); } #line 2840 "parser.cpp" break; case 138: // expr_primitive: expr_istrue -#line 619 "parser.ypp" +#line 623 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istrue::ptr > ()); } #line 2846 "parser.cpp" break; case 139: // expr_primitive: expr_reference -#line 620 "parser.ypp" +#line 624 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } #line 2852 "parser.cpp" break; case 140: // expr_primitive: expr_array -#line 621 "parser.ypp" +#line 625 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 2858 "parser.cpp" break; case 141: // expr_primitive: expr_field -#line 622 "parser.ypp" +#line 626 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 2864 "parser.cpp" break; case 142: // expr_primitive: expr_size -#line 623 "parser.ypp" +#line 627 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } #line 2870 "parser.cpp" break; case 143: // expr_primitive: expr_paren -#line 624 "parser.ypp" +#line 628 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } #line 2876 "parser.cpp" break; case 144: // expr_primitive: expr_thisthread -#line 625 "parser.ypp" +#line 629 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_thisthread::ptr > ()); } #line 2882 "parser.cpp" break; case 145: // expr_primitive: expr_empty_array -#line 626 "parser.ypp" +#line 630 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } #line 2888 "parser.cpp" break; case 146: // expr_primitive: expr_undefined -#line 627 "parser.ypp" +#line 631 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } #line 2894 "parser.cpp" break; case 147: // expr_primitive: expr_game -#line 628 "parser.ypp" +#line 632 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 2900 "parser.cpp" break; case 148: // expr_primitive: expr_self -#line 629 "parser.ypp" +#line 633 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 2906 "parser.cpp" break; case 149: // expr_primitive: expr_anim -#line 630 "parser.ypp" +#line 634 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 2912 "parser.cpp" break; case 150: // expr_primitive: expr_level -#line 631 "parser.ypp" +#line 635 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 2918 "parser.cpp" break; case 151: // expr_primitive: expr_animation -#line 632 "parser.ypp" +#line 636 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } #line 2924 "parser.cpp" break; case 152: // expr_primitive: expr_animtree -#line 633 "parser.ypp" +#line 637 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } #line 2930 "parser.cpp" break; case 153: // expr_primitive: expr_identifier -#line 634 "parser.ypp" +#line 638 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 2936 "parser.cpp" break; case 154: // expr_primitive: expr_istring -#line 635 "parser.ypp" +#line 639 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } #line 2942 "parser.cpp" break; case 155: // expr_primitive: expr_string -#line 636 "parser.ypp" +#line 640 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } #line 2948 "parser.cpp" break; case 156: // expr_primitive: expr_vector -#line 637 "parser.ypp" +#line 641 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } #line 2954 "parser.cpp" break; case 157: // expr_primitive: expr_float -#line 638 "parser.ypp" +#line 642 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } #line 2960 "parser.cpp" break; case 158: // expr_primitive: expr_integer -#line 639 "parser.ypp" +#line 643 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } #line 2966 "parser.cpp" break; case 159: // expr_primitive: expr_false -#line 640 "parser.ypp" +#line 644 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } #line 2972 "parser.cpp" break; case 160: // expr_primitive: expr_true -#line 641 "parser.ypp" +#line 645 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } #line 2978 "parser.cpp" break; case 161: // expr_complement: "~" expr -#line 646 "parser.ypp" +#line 650 "parser.ypp" { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2984 "parser.cpp" break; case 162: // expr_not: "!" expr -#line 651 "parser.ypp" +#line 655 "parser.ypp" { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2990 "parser.cpp" break; case 163: // expr_call: expr_function -#line 655 "parser.ypp" +#line 659 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 2996 "parser.cpp" break; case 164: // expr_call: expr_pointer -#line 656 "parser.ypp" +#line 660 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 3002 "parser.cpp" break; case 165: // expr_method: expr_object expr_function -#line 659 "parser.ypp" +#line 663 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 3008 "parser.cpp" break; case 166: // expr_method: expr_object expr_pointer -#line 660 "parser.ypp" +#line 664 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 3014 "parser.cpp" break; case 167: // expr_function: expr_identifier "(" expr_arguments ")" -#line 665 "parser.ypp" +#line 669 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3020 "parser.cpp" break; case 168: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 667 "parser.ypp" +#line 671 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3026 "parser.cpp" break; case 169: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 669 "parser.ypp" +#line 673 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3032 "parser.cpp" break; case 170: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 671 "parser.ypp" +#line 675 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3038 "parser.cpp" break; case 171: // expr_function: "childthread" expr_identifier "(" expr_arguments ")" -#line 673 "parser.ypp" +#line 677 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 3044 "parser.cpp" break; case 172: // expr_function: "childthread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 675 "parser.ypp" +#line 679 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 3050 "parser.cpp" break; case 173: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 680 "parser.ypp" +#line 684 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3056 "parser.cpp" break; case 174: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 682 "parser.ypp" +#line 686 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3062 "parser.cpp" break; case 175: // expr_pointer: "childthread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 684 "parser.ypp" +#line 688 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::childthread); } #line 3068 "parser.cpp" break; case 176: // expr_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 686 "parser.ypp" +#line 690 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::builtin); } #line 3074 "parser.cpp" break; case 177: // expr_add_array: "[" expr_arguments_no_empty "]" -#line 691 "parser.ypp" +#line 695 "parser.ypp" { yylhs.value.as < ast::expr_add_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ())); } #line 3080 "parser.cpp" break; case 178: // expr_parameters: expr_parameters "," expr_identifier -#line 696 "parser.ypp" +#line 700 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3086 "parser.cpp" break; case 179: // expr_parameters: expr_identifier -#line 698 "parser.ypp" +#line 702 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3092 "parser.cpp" break; case 180: // expr_parameters: %empty -#line 700 "parser.ypp" +#line 704 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } #line 3098 "parser.cpp" break; case 181: // expr_arguments: expr_arguments_no_empty -#line 705 "parser.ypp" +#line 709 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } #line 3104 "parser.cpp" break; case 182: // expr_arguments: %empty -#line 707 "parser.ypp" +#line 711 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } #line 3110 "parser.cpp" break; case 183: // expr_arguments_no_empty: expr_arguments "," expr -#line 712 "parser.ypp" +#line 716 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ()); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3116 "parser.cpp" break; case 184: // expr_arguments_no_empty: expr -#line 714 "parser.ypp" +#line 718 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3122 "parser.cpp" break; case 185: // expr_isdefined: "isdefined" "(" expr ")" -#line 719 "parser.ypp" +#line 723 "parser.ypp" { yylhs.value.as < ast::expr_isdefined::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3128 "parser.cpp" break; case 186: // expr_istrue: "istrue" "(" expr ")" -#line 724 "parser.ypp" +#line 728 "parser.ypp" { yylhs.value.as < ast::expr_istrue::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3134 "parser.cpp" break; case 187: // expr_reference: "::" expr_identifier -#line 729 "parser.ypp" +#line 733 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3140 "parser.cpp" break; case 188: // expr_reference: expr_path "::" expr_identifier -#line 731 "parser.ypp" +#line 735 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_path::ptr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3146 "parser.cpp" break; case 189: // expr_array: expr_object "[" expr "]" -#line 736 "parser.ypp" +#line 740 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3152 "parser.cpp" break; case 190: // expr_field: expr_object "." expr_identifier_nosize -#line 741 "parser.ypp" +#line 745 "parser.ypp" { yylhs.value.as < ast::expr_field::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3158 "parser.cpp" break; case 191: // expr_size: expr_object "." "size" -#line 746 "parser.ypp" +#line 750 "parser.ypp" { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } #line 3164 "parser.cpp" break; case 192: // expr_paren: "(" expr ")" -#line 751 "parser.ypp" +#line 755 "parser.ypp" { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3170 "parser.cpp" break; case 193: // expr_object: expr_call -#line 755 "parser.ypp" +#line 759 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 3176 "parser.cpp" break; case 194: // expr_object: expr_method -#line 756 "parser.ypp" +#line 760 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 3182 "parser.cpp" break; case 195: // expr_object: expr_array -#line 757 "parser.ypp" +#line 761 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 3188 "parser.cpp" break; case 196: // expr_object: expr_field -#line 758 "parser.ypp" +#line 762 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 3194 "parser.cpp" break; case 197: // expr_object: expr_game -#line 759 "parser.ypp" +#line 763 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 3200 "parser.cpp" break; case 198: // expr_object: expr_self -#line 760 "parser.ypp" +#line 764 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 3206 "parser.cpp" break; case 199: // expr_object: expr_anim -#line 761 "parser.ypp" +#line 765 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 3212 "parser.cpp" break; case 200: // expr_object: expr_level -#line 762 "parser.ypp" +#line 766 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 3218 "parser.cpp" break; case 201: // expr_object: expr_identifier -#line 763 "parser.ypp" +#line 767 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 3224 "parser.cpp" break; case 202: // expr_thisthread: "thisthread" -#line 768 "parser.ypp" +#line 772 "parser.ypp" { yylhs.value.as < ast::expr_thisthread::ptr > () = std::make_unique(yylhs.location); } #line 3230 "parser.cpp" break; case 203: // expr_empty_array: "[" "]" -#line 773 "parser.ypp" +#line 777 "parser.ypp" { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } #line 3236 "parser.cpp" break; case 204: // expr_undefined: "undefined" -#line 778 "parser.ypp" +#line 782 "parser.ypp" { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } #line 3242 "parser.cpp" break; case 205: // expr_game: "game" -#line 783 "parser.ypp" +#line 787 "parser.ypp" { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } #line 3248 "parser.cpp" break; case 206: // expr_self: "self" -#line 788 "parser.ypp" +#line 792 "parser.ypp" { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } #line 3254 "parser.cpp" break; case 207: // expr_anim: "anim" -#line 793 "parser.ypp" +#line 797 "parser.ypp" { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } #line 3260 "parser.cpp" break; case 208: // expr_level: "level" -#line 798 "parser.ypp" +#line 802 "parser.ypp" { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } #line 3266 "parser.cpp" break; case 209: // expr_animation: "%" "identifier" -#line 803 "parser.ypp" +#line 807 "parser.ypp" { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3272 "parser.cpp" break; case 210: // expr_animtree: "#animtree" -#line 808 "parser.ypp" +#line 812 "parser.ypp" { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } #line 3278 "parser.cpp" break; case 211: // expr_identifier_nosize: "identifier" -#line 813 "parser.ypp" +#line 817 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3284 "parser.cpp" break; case 212: // expr_identifier: "identifier" -#line 818 "parser.ypp" +#line 822 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3290 "parser.cpp" break; case 213: // expr_identifier: "size" -#line 820 "parser.ypp" +#line 824 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } #line 3296 "parser.cpp" break; case 214: // expr_path: "identifier" -#line 825 "parser.ypp" +#line 829 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3302 "parser.cpp" break; case 215: // expr_path: "path" -#line 827 "parser.ypp" +#line 831 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3308 "parser.cpp" break; case 216: // expr_istring: "localized string" -#line 832 "parser.ypp" +#line 836 "parser.ypp" { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3314 "parser.cpp" break; case 217: // expr_string: "string literal" -#line 837 "parser.ypp" +#line 841 "parser.ypp" { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3320 "parser.cpp" break; case 218: // expr_vector: "(" expr "," expr "," expr ")" -#line 842 "parser.ypp" +#line 846 "parser.ypp" { yylhs.value.as < ast::expr_vector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3326 "parser.cpp" break; case 219: // expr_float: "-" "float" -#line 847 "parser.ypp" +#line 851 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3332 "parser.cpp" break; case 220: // expr_float: "float" -#line 849 "parser.ypp" +#line 853 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3338 "parser.cpp" break; case 221: // expr_integer: "-" "integer" -#line 854 "parser.ypp" +#line 858 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3344 "parser.cpp" break; case 222: // expr_integer: "integer" -#line 856 "parser.ypp" +#line 860 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3350 "parser.cpp" break; case 223: // expr_false: "false" -#line 861 "parser.ypp" +#line 865 "parser.ypp" { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } #line 3356 "parser.cpp" break; case 224: // expr_true: "true" -#line 866 "parser.ypp" +#line 870 "parser.ypp" { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } #line 3362 "parser.cpp" break; @@ -3627,6 +3627,8 @@ namespace xsk { namespace gsc { namespace s4 { } + + bool parser::yy_lac_check_ (symbol_kind_type yytoken) const { @@ -3731,7 +3733,9 @@ namespace xsk { namespace gsc { namespace s4 { follows. If no initial context is currently established for the current lookahead, then check if that lookahead can eventually be shifted if syntactic actions continue from the current context. */ - if (!yy_lac_established_) + if (yy_lac_established_) + return true; + else { #if S4DEBUG YYCDEBUG << "LAC: initial context established for " @@ -3740,12 +3744,11 @@ namespace xsk { namespace gsc { namespace s4 { yy_lac_established_ = true; return yy_lac_check_ (yytoken); } - return true; } // Discard any previous initial lookahead context. void - parser::yy_lac_discard_ (const char* evt) + parser::yy_lac_discard_ (const char* event) { /* Discard any previous initial lookahead context because of Event, which may be a lookahead change or an invalidation of the currently @@ -3761,11 +3764,12 @@ namespace xsk { namespace gsc { namespace s4 { if (yy_lac_established_) { YYCDEBUG << "LAC: initial context discarded due to " - << evt << '\n'; + << event << '\n'; yy_lac_established_ = false; } } + int parser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -4559,29 +4563,29 @@ namespace xsk { namespace gsc { namespace s4 { const short parser::yyrline_[] = { - 0, 259, 259, 260, 264, 266, 268, 270, 272, 274, - 279, 283, 288, 289, 290, 291, 292, 296, 301, 306, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 339, 340, 344, 346, 351, - 353, 358, 359, 363, 364, 368, 370, 372, 375, 379, - 381, 386, 388, 390, 395, 400, 402, 407, 412, 414, - 419, 421, 426, 431, 433, 438, 443, 448, 453, 458, - 463, 465, 470, 475, 477, 482, 487, 492, 497, 499, - 504, 509, 514, 519, 520, 521, 525, 526, 530, 532, - 534, 536, 538, 540, 542, 544, 546, 548, 550, 555, - 557, 562, 564, 569, 574, 576, 578, 580, 582, 584, - 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, - 606, 608, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 645, 650, 655, 656, 659, 660, 664, 666, 668, - 670, 672, 674, 679, 681, 683, 685, 690, 695, 697, - 700, 704, 707, 711, 713, 718, 723, 728, 730, 735, - 740, 745, 750, 755, 756, 757, 758, 759, 760, 761, - 762, 763, 767, 772, 777, 782, 787, 792, 797, 802, - 807, 812, 817, 819, 824, 826, 831, 836, 841, 846, - 848, 853, 855, 860, 865 + 0, 263, 263, 264, 268, 270, 272, 274, 276, 278, + 283, 287, 292, 293, 294, 295, 296, 300, 305, 310, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 343, 344, 348, 350, 355, + 357, 362, 363, 367, 368, 372, 374, 376, 379, 383, + 385, 390, 392, 394, 399, 404, 406, 411, 416, 418, + 423, 425, 430, 435, 437, 442, 447, 452, 457, 462, + 467, 469, 474, 479, 481, 486, 491, 496, 501, 503, + 508, 513, 518, 523, 524, 525, 529, 530, 534, 536, + 538, 540, 542, 544, 546, 548, 550, 552, 554, 559, + 561, 566, 568, 573, 578, 580, 582, 584, 586, 588, + 590, 592, 594, 596, 598, 600, 602, 604, 606, 608, + 610, 612, 617, 618, 619, 620, 621, 622, 623, 624, + 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, + 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 649, 654, 659, 660, 663, 664, 668, 670, 672, + 674, 676, 678, 683, 685, 687, 689, 694, 699, 701, + 704, 708, 711, 715, 717, 722, 727, 732, 734, 739, + 744, 749, 754, 759, 760, 761, 762, 763, 764, 765, + 766, 767, 771, 776, 781, 786, 791, 796, 801, 806, + 811, 816, 821, 823, 828, 830, 835, 840, 845, 850, + 852, 857, 859, 864, 869 }; void @@ -4614,9 +4618,9 @@ namespace xsk { namespace gsc { namespace s4 { #line 13 "parser.ypp" } } } // xsk::gsc::s4 -#line 4618 "parser.cpp" +#line 4622 "parser.cpp" -#line 869 "parser.ypp" +#line 873 "parser.ypp" void xsk::gsc::s4::parser::error(const xsk::gsc::location& loc, const std::string& msg) diff --git a/src/s4/xsk/parser.hpp b/src/s4/xsk/parser.hpp index 95bd929a..c7a14d98 100644 --- a/src/s4/xsk/parser.hpp +++ b/src/s4/xsk/parser.hpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -47,10 +47,14 @@ // "%code requires" blocks. #line 28 "parser.ypp" +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "s4.hpp" namespace xsk::gsc::s4 { class lexer; } -#line 54 "parser.hpp" +#line 58 "parser.hpp" # include # include // std::abort @@ -126,12 +130,18 @@ namespace xsk::gsc::s4 { class lexer; } # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -193,7 +203,7 @@ namespace xsk::gsc::s4 { class lexer; } #line 13 "parser.ypp" namespace xsk { namespace gsc { namespace s4 { -#line 197 "parser.hpp" +#line 207 "parser.hpp" @@ -202,27 +212,32 @@ namespace xsk { namespace gsc { namespace s4 { class parser { public: -#ifndef S4STYPE +#ifdef S4STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define S4STYPE in C++, use %define api.value.type" +# endif + typedef S4STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { S4_ASSERT (sizeof (T) <= size); @@ -231,13 +246,13 @@ namespace xsk { namespace gsc { namespace s4 { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { S4_ASSERT (!yytypeid_); } @@ -381,7 +396,7 @@ namespace xsk { namespace gsc { namespace s4 { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -391,7 +406,7 @@ namespace xsk { namespace gsc { namespace s4 { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -400,7 +415,7 @@ namespace xsk { namespace gsc { namespace s4 { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -641,18 +656,19 @@ namespace xsk { namespace gsc { namespace s4 { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef S4STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef xsk::gsc::location location_type; @@ -801,7 +817,7 @@ namespace xsk { namespace gsc { namespace s4 { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -1035,7 +1051,7 @@ namespace xsk { namespace gsc { namespace s4 { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -2339,6 +2355,8 @@ namespace xsk { namespace gsc { namespace s4 { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -2673,7 +2691,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -2688,22 +2706,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { - /// Default constructor. - by_kind (); - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that); -#endif - - /// Copy constructor. - by_kind (const by_kind& that); - /// The symbol kind as needed by the constructor. typedef token_kind_type kind_type; + /// Default constructor. + by_kind () YY_NOEXCEPT; + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that) YY_NOEXCEPT; +#endif + + /// Copy constructor. + by_kind (const by_kind& that) YY_NOEXCEPT; + /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -2733,30 +2753,34 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ S4_ASSERT (tok == token::S4EOF || (token::S4error <= tok && tok <= token::MOD) || (token::SIZEOF <= tok && tok <= token::POSTDEC)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ S4_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); +#endif } }; @@ -2805,7 +2829,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static const char *symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -4587,19 +4611,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const short yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; @@ -4626,14 +4650,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const unsigned char yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const unsigned char yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -4732,7 +4756,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -4811,7 +4835,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -4870,7 +4894,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -4889,7 +4913,7 @@ switch (yykind) inline parser::symbol_kind_type - parser::yytranslate_ (int t) + parser::yytranslate_ (int t) YY_NOEXCEPT { return static_cast (t); } @@ -5206,6 +5230,7 @@ switch (yykind) + template parser::symbol_kind_type parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -5213,6 +5238,7 @@ switch (yykind) return this->kind (); } + template bool parser::basic_symbol::empty () const YY_NOEXCEPT @@ -5531,13 +5557,13 @@ switch (yykind) // by_kind. inline - parser::by_kind::by_kind () + parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - parser::by_kind::by_kind (by_kind&& that) + parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -5545,15 +5571,17 @@ switch (yykind) #endif inline - parser::by_kind::by_kind (const by_kind& that) + parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - parser::by_kind::by_kind (token_kind_type t) + parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void parser::by_kind::clear () YY_NOEXCEPT @@ -5576,6 +5604,7 @@ switch (yykind) return kind_; } + inline parser::symbol_kind_type parser::by_kind::type_get () const YY_NOEXCEPT @@ -5583,9 +5612,10 @@ switch (yykind) return this->kind (); } + #line 13 "parser.ypp" } } } // xsk::gsc::s4 -#line 5589 "parser.hpp" +#line 5619 "parser.hpp" diff --git a/src/s4/xsk/resolver.cpp b/src/s4/xsk/resolver.cpp index f9da26f7..38701b61 100644 --- a/src/s4/xsk/resolver.cpp +++ b/src/s4/xsk/resolver.cpp @@ -6,6 +6,11 @@ #include "stdafx.hpp" #include "s4.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4244) +#endif + namespace xsk::gsc::s4 { @@ -61,7 +66,7 @@ auto resolver::function_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_func_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = function_map_rev.find(name); @@ -90,7 +95,7 @@ auto resolver::method_id(const std::string& name) -> std::uint16_t { if (name.starts_with("_meth_")) { - return std::stoul(name.substr(6), nullptr, 16); + return static_cast(std::stoul(name.substr(6), nullptr, 16)); } const auto itr = method_map_rev.find(name); @@ -119,7 +124,7 @@ auto resolver::file_id(const std::string& name) -> std::uint32_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = file_map_rev.find(name); @@ -148,7 +153,7 @@ auto resolver::token_id(const std::string& name) -> std::uint32_t { if (name.starts_with("_id_")) { - return std::stoul(name.substr(4), nullptr, 16); + return static_cast(std::stoul(name.substr(4), nullptr, 16)); } const auto itr = token_map_rev.find(name); @@ -212,7 +217,7 @@ auto resolver::make_token(std::string_view str) -> std::string for (std::size_t i = 0; i < data.size(); i++) { - data[i] = std::tolower(str[i]); + data[i] = static_cast(std::tolower(static_cast(str[i]))); if (data[i] == '\\') data[i] = '/'; } @@ -539,3 +544,7 @@ struct __init__ __init__ _; } // namespace xsk::gsc::s4 + +#ifdef _MSC_VER +#pragma warning(pop) +#endif diff --git a/src/t6/stdafx.hpp b/src/t6/stdafx.hpp index cf2f3255..19f22f43 100644 --- a/src/t6/stdafx.hpp +++ b/src/t6/stdafx.hpp @@ -5,38 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4005) -#pragma warning(disable:4018) -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4389) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include -// Ext using namespace std::literals; - -#include "xsk/t6.hpp" diff --git a/src/t6/xsk/assembler.cpp b/src/t6/xsk/assembler.cpp index 2fb9e13e..a658bc64 100644 --- a/src/t6/xsk/assembler.cpp +++ b/src/t6/xsk/assembler.cpp @@ -56,7 +56,7 @@ void assembler::assemble(const std::string& file, assembly::ptr& data) // assemble includes header_.include_offset = script_->pos(); - header_.include_count = assembly_->includes.size(); + header_.include_count = static_cast(assembly_->includes.size()); for (const auto& entry : assembly_->includes) { @@ -79,7 +79,7 @@ void assembler::assemble(const std::string& file, assembly::ptr& data) // assemble exports header_.exports_offset = script_->pos(); - header_.exports_count = exports_.size(); + header_.exports_count = static_cast(exports_.size()); for (const auto& entry : exports_) { @@ -92,13 +92,13 @@ void assembler::assemble(const std::string& file, assembly::ptr& data) // assemble imports header_.imports_offset = script_->pos(); - header_.imports_count = imports_.size(); + header_.imports_count = static_cast(imports_.size()); for (const auto& entry : imports_) { script_->write(string_offset(entry.name)); script_->write(string_offset(entry.space)); - script_->write(entry.refs.size()); + script_->write(static_cast(entry.refs.size())); script_->write(entry.params); script_->write(entry.flags); @@ -110,13 +110,13 @@ void assembler::assemble(const std::string& file, assembly::ptr& data) // assemble animtrees header_.animtree_offset = script_->pos(); - header_.animtree_count = animtrees_.size(); + header_.animtree_count = static_cast(animtrees_.size()); for (const auto& entry : animtrees_) { script_->write(string_offset(entry.name)); - script_->write(entry.refs.size()); - script_->write(entry.anims.size()); + script_->write(static_cast(entry.refs.size())); + script_->write(static_cast(entry.anims.size())); script_->seek(2); for (const auto& ref : entry.refs) @@ -133,12 +133,12 @@ void assembler::assemble(const std::string& file, assembly::ptr& data) // assemble stringtable header_.stringtablefixup_offset = script_->pos(); - header_.stringtablefixup_count = stringtables_.size(); + header_.stringtablefixup_count = static_cast(stringtables_.size()); for (const auto& entry : stringtables_) { script_->write(string_offset(entry.name)); - script_->write(entry.refs.size()); + script_->write(static_cast(entry.refs.size())); script_->write(entry.type); for (const auto& ref : entry.refs) @@ -444,7 +444,7 @@ void assembler::assemble_jump(const instruction::ptr& inst) { script_->write(static_cast(inst->opcode)); - const std::int16_t addr = resolve_label(inst->data[0]) - inst->index - inst->size; + const auto addr = static_cast(resolve_label(inst->data[0]) - inst->index - inst->size); script_->align(2); script_->write(addr); @@ -501,7 +501,7 @@ void assembler::assemble_devblock(const instruction::ptr& inst) { script_->write(static_cast(inst->opcode)); - const std::int16_t addr = resolve_label(inst->data[0]) - inst->index - inst->size; + const auto addr = static_cast(resolve_label(inst->data[0]) - inst->index - inst->size); script_->align(2); script_->write(addr); @@ -735,7 +735,7 @@ void assembler::process_string(const std::string& data) { if (!stringlist_.contains(data)) { - auto pos = script_->pos(); + auto pos = static_cast(script_->pos()); script_->write_c_string(data); stringlist_.insert({ data, pos }); } @@ -823,7 +823,7 @@ auto assembler::resolve_label(const std::string& name) -> std::int32_t throw asm_error("Couldn't resolve label address of '" + name + "'!"); } -auto assembler::string_offset(const std::string& name) -> std::uint32_t +auto assembler::string_offset(const std::string& name) -> std::uint16_t { const auto& itr = stringlist_.find(name); @@ -863,8 +863,8 @@ void assembler::add_import_reference(const std::vector& data, std:: import_ref n; n.space = data[0]; n.name = data[1]; - n.params = std::stoi(data[2]); - n.flags = std::stoi(data[3]); + n.params = static_cast(std::stoi(data[2])); + n.flags = static_cast(std::stoi(data[3])); n.refs.push_back(ref); imports_.push_back(std::move(n)); } diff --git a/src/t6/xsk/assembler.hpp b/src/t6/xsk/assembler.hpp index f797b89d..73f1b62d 100644 --- a/src/t6/xsk/assembler.hpp +++ b/src/t6/xsk/assembler.hpp @@ -39,7 +39,7 @@ private: void process_instruction(const instruction::ptr& inst); void align_instruction(const instruction::ptr& inst); auto resolve_label(const std::string& name) -> std::int32_t; - auto string_offset(const std::string& data) -> std::uint32_t; + auto string_offset(const std::string& data) -> std::uint16_t; void add_string_reference(const std::string& str, string_type type, std::uint32_t ref); void add_import_reference(const std::vector& data, std::uint32_t ref); void add_anim_reference(const std::vector& data, std::uint32_t ref); diff --git a/src/t6/xsk/compiler.cpp b/src/t6/xsk/compiler.cpp index d8a78fd4..f71278c2 100644 --- a/src/t6/xsk/compiler.cpp +++ b/src/t6/xsk/compiler.cpp @@ -169,7 +169,7 @@ void compiler::emit_decl_thread(const ast::decl_thread::ptr& thread) function_ = std::make_unique(); function_->index = index_; function_->name = thread->name->value; - function_->params = thread->params->list.size(); + function_->params = static_cast(thread->params->list.size()); function_->flags = 0; stack_idx_ = 0; diff --git a/src/t6/xsk/decompiler.cpp b/src/t6/xsk/decompiler.cpp index c2d945d7..4f570888 100644 --- a/src/t6/xsk/decompiler.cpp +++ b/src/t6/xsk/decompiler.cpp @@ -1285,7 +1285,7 @@ void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) void decompiler::decompile_infinites(const ast::stmt_list::ptr& stmt) { - for (int i = stmt->list.size() - 1; i >= 0; i--) + for (auto i = stmt->list.size() - 1; i > 0; i--) { if (stmt->list.at(i) == ast::kind::asm_jump) { @@ -1298,7 +1298,7 @@ void decompiler::decompile_infinites(const ast::stmt_list::ptr& stmt) auto break_loc = last_location_index(stmt, i) ? blocks_.back().loc_end : stmt->list.at(i + 1).loc().label(); auto start = find_location_index(stmt, stmt->list.at(i).as_jump->value); - if (i > 0 && stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond && stmt->list.at(i - 1).as_cond->value == break_loc) + if (stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond && stmt->list.at(i - 1).as_cond->value == break_loc) { continue; } @@ -1522,7 +1522,7 @@ void decompiler::decompile_devblocks(const ast::stmt_list::ptr& stmt) } } -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_end = stmt->list.at(begin).as_cond->value; @@ -1550,7 +1550,7 @@ void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t beg stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block if_blk; if_blk.loc_end = stmt->list.at(end).loc().label(); @@ -1601,7 +1601,7 @@ void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); @@ -1631,7 +1631,7 @@ void decompiler::decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32 stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_loop(const ast::stmt_list::ptr& stmt, std::uint32_t start, std::uint32_t end) +void decompiler::decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t start, std::size_t end) { auto& last = stmt->list.at(end - 1); @@ -1699,7 +1699,7 @@ void decompiler::decompile_loop(const ast::stmt_list::ptr& stmt, std::uint32_t s decompile_while(stmt, start, end); } -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -1729,7 +1729,7 @@ void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); @@ -1757,7 +1757,7 @@ void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -1798,7 +1798,7 @@ void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t be stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end) +void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) { block blk; blk.loc_break = stmt->list.at(begin).as_cond->value; @@ -1847,7 +1847,7 @@ void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_ stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); } -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t start) +void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) { block blk; blk.loc_continue = blocks_.back().loc_continue; @@ -1960,7 +1960,7 @@ void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); } -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool +auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool { for (auto i = begin; i < end; i++) { @@ -1983,7 +1983,7 @@ auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::u return false; } -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t +auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t { auto index = 0u; @@ -2001,7 +2001,7 @@ auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std: throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); } -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool +auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool { if (index == stmt->list.size() - 1) return true; diff --git a/src/t6/xsk/decompiler.hpp b/src/t6/xsk/decompiler.hpp index b6407f4c..40622d52 100644 --- a/src/t6/xsk/decompiler.hpp +++ b/src/t6/xsk/decompiler.hpp @@ -38,18 +38,18 @@ private: void decompile_ifelses(const ast::stmt_list::ptr& stmt); void decompile_aborts(const ast::stmt_list::ptr& stmt); void decompile_devblocks(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool; + void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_infinite(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); + void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); + auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; + auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; + auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; auto lvalues_match(const ast::stmt_assign::ptr& stmt1, const ast::stmt_assign::ptr& stmt2) -> bool; auto resolve_label(const std::string& name) -> std::uint32_t; void process_thread(const ast::decl_thread::ptr& thread); diff --git a/src/t6/xsk/disassembler.cpp b/src/t6/xsk/disassembler.cpp index 4d4af7a8..b083014f 100644 --- a/src/t6/xsk/disassembler.cpp +++ b/src/t6/xsk/disassembler.cpp @@ -83,7 +83,7 @@ void disassembler::disassemble(const std::string& file, std::vectorpos() < header_.include_offset) { - std::uint16_t pos = script_->pos(); + auto pos = script_->pos(); stringlist_.insert({ pos, script_->read_c_string() }); } diff --git a/src/t6/xsk/lexer.cpp b/src/t6/xsk/lexer.cpp index 164f06fd..ba6ff8d8 100644 --- a/src/t6/xsk/lexer.cpp +++ b/src/t6/xsk/lexer.cpp @@ -110,7 +110,7 @@ void reader::init(const char* data, size_t size) { state = reader::ok; buffer_pos = data; - bytes_remaining = size; + bytes_remaining = static_cast(size); last_byte = 0; current_byte = *data; } diff --git a/src/t6/xsk/parser.cpp b/src/t6/xsk/parser.cpp index ed579b0c..392146f2 100644 --- a/src/t6/xsk/parser.cpp +++ b/src/t6/xsk/parser.cpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -35,7 +35,7 @@ // private implementation details that can be changed or removed. // "%code top" blocks. -#line 34 "parser.ypp" +#line 38 "parser.ypp" #include "stdafx.hpp" #include "parser.hpp" @@ -166,9 +166,9 @@ namespace xsk { namespace arc { namespace t6 { parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ @@ -1711,7 +1711,7 @@ namespace xsk { namespace arc { namespace t6 { } void - parser::yypop_ (int n) + parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -1754,13 +1754,13 @@ namespace xsk { namespace arc { namespace t6 { } bool - parser::yy_pact_value_is_default_ (int yyvalue) + parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - parser::yy_table_value_is_error_ (int yyvalue) + parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -1791,8 +1791,8 @@ namespace xsk { namespace arc { namespace t6 { /// The return value of parse (). int yyresult; - /// Discard the LAC context in case there still is one left from a - /// previous invocation. + // Discard the LAC context in case there still is one left from a + // previous invocation. yy_lac_discard_ ("init"); #if YY_EXCEPTIONS @@ -1870,7 +1870,7 @@ namespace xsk { namespace arc { namespace t6 { if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) { if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; goto yydefault; } @@ -1881,7 +1881,7 @@ namespace xsk { namespace arc { namespace t6 { if (yy_table_value_is_error_ (yyn)) goto yyerrlab; if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; + goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -2289,1507 +2289,1507 @@ namespace xsk { namespace arc { namespace t6 { switch (yyn) { case 2: // root: program -#line 283 "parser.ypp" +#line 287 "parser.ypp" { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } #line 2295 "parser.cpp" break; case 3: // root: %empty -#line 284 "parser.ypp" +#line 288 "parser.ypp" { ast = std::make_unique(yylhs.location); } #line 2301 "parser.cpp" break; case 4: // program: program inline -#line 289 "parser.ypp" +#line 293 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } #line 2307 "parser.cpp" break; case 5: // program: program include -#line 291 "parser.ypp" +#line 295 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2313 "parser.cpp" break; case 6: // program: program declaration -#line 293 "parser.ypp" +#line 297 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2319 "parser.cpp" break; case 7: // program: inline -#line 295 "parser.ypp" +#line 299 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } #line 2325 "parser.cpp" break; case 8: // program: include -#line 297 "parser.ypp" +#line 301 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } #line 2331 "parser.cpp" break; case 9: // program: declaration -#line 299 "parser.ypp" +#line 303 "parser.ypp" { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } #line 2337 "parser.cpp" break; case 10: // inline: "#inline" expr_path ";" -#line 303 "parser.ypp" +#line 307 "parser.ypp" { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } #line 2343 "parser.cpp" break; case 11: // include: "#include" expr_path ";" -#line 308 "parser.ypp" +#line 312 "parser.ypp" { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } #line 2349 "parser.cpp" break; case 12: // declaration: "/#" -#line 312 "parser.ypp" +#line 316 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } #line 2355 "parser.cpp" break; case 13: // declaration: "#/" -#line 313 "parser.ypp" +#line 317 "parser.ypp" { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } #line 2361 "parser.cpp" break; case 14: // declaration: decl_usingtree -#line 314 "parser.ypp" +#line 318 "parser.ypp" { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } #line 2367 "parser.cpp" break; case 15: // declaration: decl_constant -#line 315 "parser.ypp" +#line 319 "parser.ypp" { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } #line 2373 "parser.cpp" break; case 16: // declaration: decl_thread -#line 316 "parser.ypp" +#line 320 "parser.ypp" { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } #line 2379 "parser.cpp" break; case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 321 "parser.ypp" +#line 325 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_usingtree::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_string::ptr > ())); } #line 2385 "parser.cpp" break; case 18: // decl_constant: expr_identifier "=" expr ";" -#line 326 "parser.ypp" +#line 330 "parser.ypp" { yylhs.value.as < ast::decl_constant::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 2391 "parser.cpp" break; case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 331 "parser.ypp" +#line 335 "parser.ypp" { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2397 "parser.cpp" break; case 20: // stmt: stmt_block -#line 335 "parser.ypp" +#line 339 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } #line 2403 "parser.cpp" break; case 21: // stmt: stmt_call -#line 336 "parser.ypp" +#line 340 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } #line 2409 "parser.cpp" break; case 22: // stmt: stmt_assign -#line 337 "parser.ypp" +#line 341 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } #line 2415 "parser.cpp" break; case 23: // stmt: stmt_endon -#line 338 "parser.ypp" +#line 342 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } #line 2421 "parser.cpp" break; case 24: // stmt: stmt_notify -#line 339 "parser.ypp" +#line 343 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } #line 2427 "parser.cpp" break; case 25: // stmt: stmt_wait -#line 340 "parser.ypp" +#line 344 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } #line 2433 "parser.cpp" break; case 26: // stmt: stmt_waittill -#line 341 "parser.ypp" +#line 345 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } #line 2439 "parser.cpp" break; case 27: // stmt: stmt_waittillmatch -#line 342 "parser.ypp" +#line 346 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } #line 2445 "parser.cpp" break; case 28: // stmt: stmt_waittillframeend -#line 343 "parser.ypp" +#line 347 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } #line 2451 "parser.cpp" break; case 29: // stmt: stmt_if -#line 344 "parser.ypp" +#line 348 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } #line 2457 "parser.cpp" break; case 30: // stmt: stmt_ifelse -#line 345 "parser.ypp" +#line 349 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } #line 2463 "parser.cpp" break; case 31: // stmt: stmt_while -#line 346 "parser.ypp" +#line 350 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } #line 2469 "parser.cpp" break; case 32: // stmt: stmt_dowhile -#line 347 "parser.ypp" +#line 351 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } #line 2475 "parser.cpp" break; case 33: // stmt: stmt_for -#line 348 "parser.ypp" +#line 352 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } #line 2481 "parser.cpp" break; case 34: // stmt: stmt_foreach -#line 349 "parser.ypp" +#line 353 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } #line 2487 "parser.cpp" break; case 35: // stmt: stmt_switch -#line 350 "parser.ypp" +#line 354 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } #line 2493 "parser.cpp" break; case 36: // stmt: stmt_case -#line 351 "parser.ypp" +#line 355 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } #line 2499 "parser.cpp" break; case 37: // stmt: stmt_default -#line 352 "parser.ypp" +#line 356 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } #line 2505 "parser.cpp" break; case 38: // stmt: stmt_break -#line 353 "parser.ypp" +#line 357 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } #line 2511 "parser.cpp" break; case 39: // stmt: stmt_continue -#line 354 "parser.ypp" +#line 358 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } #line 2517 "parser.cpp" break; case 40: // stmt: stmt_return -#line 355 "parser.ypp" +#line 359 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } #line 2523 "parser.cpp" break; case 41: // stmt: stmt_prof_begin -#line 356 "parser.ypp" +#line 360 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } #line 2529 "parser.cpp" break; case 42: // stmt: stmt_prof_end -#line 357 "parser.ypp" +#line 361 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } #line 2535 "parser.cpp" break; case 43: // stmt_or_dev: stmt -#line 361 "parser.ypp" +#line 365 "parser.ypp" { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } #line 2541 "parser.cpp" break; case 44: // stmt_or_dev: stmt_dev -#line 362 "parser.ypp" +#line 366 "parser.ypp" { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } #line 2547 "parser.cpp" break; case 45: // stmt_list: stmt_list stmt -#line 367 "parser.ypp" +#line 371 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2553 "parser.cpp" break; case 46: // stmt_list: stmt -#line 369 "parser.ypp" +#line 373 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2559 "parser.cpp" break; case 47: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 374 "parser.ypp" +#line 378 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2565 "parser.cpp" break; case 48: // stmt_or_dev_list: stmt_or_dev -#line 376 "parser.ypp" +#line 380 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2571 "parser.cpp" break; case 49: // stmt_dev: "/#" stmt_list "#/" -#line 380 "parser.ypp" +#line 384 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::stmt_list::ptr > ())); } #line 2577 "parser.cpp" break; case 50: // stmt_dev: "/#" "#/" -#line 381 "parser.ypp" +#line 385 "parser.ypp" { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2583 "parser.cpp" break; case 51: // stmt_block: "{" stmt_or_dev_list "}" -#line 385 "parser.ypp" +#line 389 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } #line 2589 "parser.cpp" break; case 52: // stmt_block: "{" "}" -#line 386 "parser.ypp" +#line 390 "parser.ypp" { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } #line 2595 "parser.cpp" break; case 53: // stmt_expr: expr_assign -#line 391 "parser.ypp" +#line 395 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2601 "parser.cpp" break; case 54: // stmt_expr: expr_increment -#line 393 "parser.ypp" +#line 397 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2607 "parser.cpp" break; case 55: // stmt_expr: expr_decrement -#line 395 "parser.ypp" +#line 399 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 2613 "parser.cpp" break; case 56: // stmt_expr: %empty -#line 397 "parser.ypp" +#line 401 "parser.ypp" { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2619 "parser.cpp" break; case 57: // stmt_call: expr_call ";" -#line 402 "parser.ypp" +#line 406 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_call::ptr > ()))); } #line 2625 "parser.cpp" break; case 58: // stmt_call: expr_method ";" -#line 404 "parser.ypp" +#line 408 "parser.ypp" { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_method::ptr > ()))); } #line 2631 "parser.cpp" break; case 59: // stmt_assign: expr_assign ";" -#line 409 "parser.ypp" +#line 413 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2637 "parser.cpp" break; case 60: // stmt_assign: expr_increment ";" -#line 411 "parser.ypp" +#line 415 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2643 "parser.cpp" break; case 61: // stmt_assign: expr_decrement ";" -#line 413 "parser.ypp" +#line 417 "parser.ypp" { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2649 "parser.cpp" break; case 62: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 418 "parser.ypp" +#line 422 "parser.ypp" { yylhs.value.as < ast::stmt_endon::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ())); } #line 2655 "parser.cpp" break; case 63: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 423 "parser.ypp" +#line 427 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2661 "parser.cpp" break; case 64: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 425 "parser.ypp" +#line 429 "parser.ypp" { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2667 "parser.cpp" break; case 65: // stmt_wait: "wait" expr ";" -#line 430 "parser.ypp" +#line 434 "parser.ypp" { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2673 "parser.cpp" break; case 66: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 435 "parser.ypp" +#line 439 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2679 "parser.cpp" break; case 67: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 437 "parser.ypp" +#line 441 "parser.ypp" { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2685 "parser.cpp" break; case 68: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 442 "parser.ypp" +#line 446 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2691 "parser.cpp" break; case 69: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 444 "parser.ypp" +#line 448 "parser.ypp" { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } #line 2697 "parser.cpp" break; case 70: // stmt_waittillframeend: "waittillframeend" ";" -#line 449 "parser.ypp" +#line 453 "parser.ypp" { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } #line 2703 "parser.cpp" break; case 71: // stmt_if: "if" "(" expr ")" stmt -#line 454 "parser.ypp" +#line 458 "parser.ypp" { yylhs.value.as < ast::stmt_if::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2709 "parser.cpp" break; case 72: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 459 "parser.ypp" +#line 463 "parser.ypp" { yylhs.value.as < ast::stmt_ifelse::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::stmt > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2715 "parser.cpp" break; case 73: // stmt_while: "while" "(" expr ")" stmt -#line 464 "parser.ypp" +#line 468 "parser.ypp" { yylhs.value.as < ast::stmt_while::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2721 "parser.cpp" break; case 74: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 469 "parser.ypp" +#line 473 "parser.ypp" { yylhs.value.as < ast::stmt_dowhile::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[5].value.as < ast::stmt > ())); } #line 2727 "parser.cpp" break; case 75: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 474 "parser.ypp" +#line 478 "parser.ypp" { yylhs.value.as < ast::stmt_for::ptr > () = std::make_unique(yylhs.location, ast::stmt(std::move(yystack_[6].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[4].value.as < ast::expr > ()), ast::stmt(std::move(yystack_[2].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2733 "parser.cpp" break; case 76: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 479 "parser.ypp" +#line 483 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2739 "parser.cpp" break; case 77: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 481 "parser.ypp" +#line 485 "parser.ypp" { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[6].value.as < ast::expr_identifier::ptr > ())), ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } #line 2745 "parser.cpp" break; case 78: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 486 "parser.ypp" +#line 490 "parser.ypp" { yylhs.value.as < ast::stmt_switch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } #line 2751 "parser.cpp" break; case 79: // stmt_case: "case" expr_integer ":" -#line 491 "parser.ypp" +#line 495 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_integer::ptr > ())), std::make_unique(yylhs.location)); } #line 2757 "parser.cpp" break; case 80: // stmt_case: "case" expr_string ":" -#line 493 "parser.ypp" +#line 497 "parser.ypp" { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_string::ptr > ())), std::make_unique(yylhs.location)); } #line 2763 "parser.cpp" break; case 81: // stmt_default: "default" ":" -#line 498 "parser.ypp" +#line 502 "parser.ypp" { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2769 "parser.cpp" break; case 82: // stmt_break: "break" ";" -#line 503 "parser.ypp" +#line 507 "parser.ypp" { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } #line 2775 "parser.cpp" break; case 83: // stmt_continue: "continue" ";" -#line 508 "parser.ypp" +#line 512 "parser.ypp" { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } #line 2781 "parser.cpp" break; case 84: // stmt_return: "return" expr ";" -#line 513 "parser.ypp" +#line 517 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 2787 "parser.cpp" break; case 85: // stmt_return: "return" ";" -#line 515 "parser.ypp" +#line 519 "parser.ypp" { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } #line 2793 "parser.cpp" break; case 86: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 520 "parser.ypp" +#line 524 "parser.ypp" { yylhs.value.as < ast::stmt_prof_begin::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2799 "parser.cpp" break; case 87: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 525 "parser.ypp" +#line 529 "parser.ypp" { yylhs.value.as < ast::stmt_prof_end::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } #line 2805 "parser.cpp" break; case 88: // expr: expr_ternary -#line 529 "parser.ypp" +#line 533 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2811 "parser.cpp" break; case 89: // expr: expr_binary -#line 530 "parser.ypp" +#line 534 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2817 "parser.cpp" break; case 90: // expr: expr_primitive -#line 531 "parser.ypp" +#line 535 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2823 "parser.cpp" break; case 91: // expr_or_empty: expr -#line 535 "parser.ypp" +#line 539 "parser.ypp" { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } #line 2829 "parser.cpp" break; case 92: // expr_or_empty: %empty -#line 536 "parser.ypp" +#line 540 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } #line 2835 "parser.cpp" break; case 93: // expr_assign: expr_object "=" expr -#line 541 "parser.ypp" +#line 545 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2841 "parser.cpp" break; case 94: // expr_assign: expr_object "|=" expr -#line 543 "parser.ypp" +#line 547 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2847 "parser.cpp" break; case 95: // expr_assign: expr_object "&=" expr -#line 545 "parser.ypp" +#line 549 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2853 "parser.cpp" break; case 96: // expr_assign: expr_object "^=" expr -#line 547 "parser.ypp" +#line 551 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2859 "parser.cpp" break; case 97: // expr_assign: expr_object "<<=" expr -#line 549 "parser.ypp" +#line 553 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()),std::move( yystack_[0].value.as < ast::expr > ())); } #line 2865 "parser.cpp" break; case 98: // expr_assign: expr_object ">>=" expr -#line 551 "parser.ypp" +#line 555 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2871 "parser.cpp" break; case 99: // expr_assign: expr_object "+=" expr -#line 553 "parser.ypp" +#line 557 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2877 "parser.cpp" break; case 100: // expr_assign: expr_object "-=" expr -#line 555 "parser.ypp" +#line 559 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2883 "parser.cpp" break; case 101: // expr_assign: expr_object "*=" expr -#line 557 "parser.ypp" +#line 561 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2889 "parser.cpp" break; case 102: // expr_assign: expr_object "/=" expr -#line 559 "parser.ypp" +#line 563 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2895 "parser.cpp" break; case 103: // expr_assign: expr_object "%=" expr -#line 561 "parser.ypp" +#line 565 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2901 "parser.cpp" break; case 104: // expr_increment: "++" expr_object -#line 566 "parser.ypp" +#line 570 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2907 "parser.cpp" break; case 105: // expr_increment: expr_object "++" -#line 568 "parser.ypp" +#line 572 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2913 "parser.cpp" break; case 106: // expr_decrement: "--" expr_object -#line 573 "parser.ypp" +#line 577 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } #line 2919 "parser.cpp" break; case 107: // expr_decrement: expr_object "--" -#line 575 "parser.ypp" +#line 579 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } #line 2925 "parser.cpp" break; case 108: // expr_ternary: expr "?" expr ":" expr -#line 580 "parser.ypp" +#line 584 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2931 "parser.cpp" break; case 109: // expr_binary: expr "||" expr -#line 585 "parser.ypp" +#line 589 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2937 "parser.cpp" break; case 110: // expr_binary: expr "&&" expr -#line 587 "parser.ypp" +#line 591 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2943 "parser.cpp" break; case 111: // expr_binary: expr "==" expr -#line 589 "parser.ypp" +#line 593 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2949 "parser.cpp" break; case 112: // expr_binary: expr "!=" expr -#line 591 "parser.ypp" +#line 595 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2955 "parser.cpp" break; case 113: // expr_binary: expr "<=" expr -#line 593 "parser.ypp" +#line 597 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2961 "parser.cpp" break; case 114: // expr_binary: expr ">=" expr -#line 595 "parser.ypp" +#line 599 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2967 "parser.cpp" break; case 115: // expr_binary: expr "<" expr -#line 597 "parser.ypp" +#line 601 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2973 "parser.cpp" break; case 116: // expr_binary: expr ">" expr -#line 599 "parser.ypp" +#line 603 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2979 "parser.cpp" break; case 117: // expr_binary: expr "|" expr -#line 601 "parser.ypp" +#line 605 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2985 "parser.cpp" break; case 118: // expr_binary: expr "&" expr -#line 603 "parser.ypp" +#line 607 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2991 "parser.cpp" break; case 119: // expr_binary: expr "^" expr -#line 605 "parser.ypp" +#line 609 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 2997 "parser.cpp" break; case 120: // expr_binary: expr "<<" expr -#line 607 "parser.ypp" +#line 611 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3003 "parser.cpp" break; case 121: // expr_binary: expr ">>" expr -#line 609 "parser.ypp" +#line 613 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3009 "parser.cpp" break; case 122: // expr_binary: expr "+" expr -#line 611 "parser.ypp" +#line 615 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3015 "parser.cpp" break; case 123: // expr_binary: expr "-" expr -#line 613 "parser.ypp" +#line 617 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3021 "parser.cpp" break; case 124: // expr_binary: expr "*" expr -#line 615 "parser.ypp" +#line 619 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3027 "parser.cpp" break; case 125: // expr_binary: expr "/" expr -#line 617 "parser.ypp" +#line 621 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3033 "parser.cpp" break; case 126: // expr_binary: expr "%" expr -#line 619 "parser.ypp" +#line 623 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } #line 3039 "parser.cpp" break; case 127: // expr_primitive: expr_complement -#line 623 "parser.ypp" +#line 627 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } #line 3045 "parser.cpp" break; case 128: // expr_primitive: expr_not -#line 624 "parser.ypp" +#line 628 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } #line 3051 "parser.cpp" break; case 129: // expr_primitive: expr_call -#line 625 "parser.ypp" +#line 629 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 3057 "parser.cpp" break; case 130: // expr_primitive: expr_method -#line 626 "parser.ypp" +#line 630 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 3063 "parser.cpp" break; case 131: // expr_primitive: expr_getnextarraykey -#line 627 "parser.ypp" +#line 631 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getnextarraykey::ptr > ()); } #line 3069 "parser.cpp" break; case 132: // expr_primitive: expr_getfirstarraykey -#line 628 "parser.ypp" +#line 632 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getfirstarraykey::ptr > ()); } #line 3075 "parser.cpp" break; case 133: // expr_primitive: expr_getdvarcoloralpha -#line 629 "parser.ypp" +#line 633 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcoloralpha::ptr > ()); } #line 3081 "parser.cpp" break; case 134: // expr_primitive: expr_getdvarcolorblue -#line 630 "parser.ypp" +#line 634 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcolorblue::ptr > ()); } #line 3087 "parser.cpp" break; case 135: // expr_primitive: expr_getdvarcolorgreen -#line 631 "parser.ypp" +#line 635 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcolorgreen::ptr > ()); } #line 3093 "parser.cpp" break; case 136: // expr_primitive: expr_getdvarcolorred -#line 632 "parser.ypp" +#line 636 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcolorred::ptr > ()); } #line 3099 "parser.cpp" break; case 137: // expr_primitive: expr_getdvarvector -#line 633 "parser.ypp" +#line 637 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarvector::ptr > ()); } #line 3105 "parser.cpp" break; case 138: // expr_primitive: expr_getdvarfloat -#line 634 "parser.ypp" +#line 638 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarfloat::ptr > ()); } #line 3111 "parser.cpp" break; case 139: // expr_primitive: expr_getdvarint -#line 635 "parser.ypp" +#line 639 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarint::ptr > ()); } #line 3117 "parser.cpp" break; case 140: // expr_primitive: expr_getdvar -#line 636 "parser.ypp" +#line 640 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvar::ptr > ()); } #line 3123 "parser.cpp" break; case 141: // expr_primitive: expr_gettime -#line 637 "parser.ypp" +#line 641 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_gettime::ptr > ()); } #line 3129 "parser.cpp" break; case 142: // expr_primitive: expr_abs -#line 638 "parser.ypp" +#line 642 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_abs::ptr > ()); } #line 3135 "parser.cpp" break; case 143: // expr_primitive: expr_vectortoangles -#line 639 "parser.ypp" +#line 643 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vectortoangles::ptr > ()); } #line 3141 "parser.cpp" break; case 144: // expr_primitive: expr_angleclamp180 -#line 640 "parser.ypp" +#line 644 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_angleclamp180::ptr > ()); } #line 3147 "parser.cpp" break; case 145: // expr_primitive: expr_anglestoforward -#line 641 "parser.ypp" +#line 645 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anglestoforward::ptr > ()); } #line 3153 "parser.cpp" break; case 146: // expr_primitive: expr_anglestoright -#line 642 "parser.ypp" +#line 646 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anglestoright::ptr > ()); } #line 3159 "parser.cpp" break; case 147: // expr_primitive: expr_anglestoup -#line 643 "parser.ypp" +#line 647 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anglestoup::ptr > ()); } #line 3165 "parser.cpp" break; case 148: // expr_primitive: expr_vectorscale -#line 644 "parser.ypp" +#line 648 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vectorscale::ptr > ()); } #line 3171 "parser.cpp" break; case 149: // expr_primitive: expr_isdefined -#line 645 "parser.ypp" +#line 649 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_isdefined::ptr > ()); } #line 3177 "parser.cpp" break; case 150: // expr_primitive: expr_reference -#line 646 "parser.ypp" +#line 650 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } #line 3183 "parser.cpp" break; case 151: // expr_primitive: expr_array -#line 647 "parser.ypp" +#line 651 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 3189 "parser.cpp" break; case 152: // expr_primitive: expr_field -#line 648 "parser.ypp" +#line 652 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 3195 "parser.cpp" break; case 153: // expr_primitive: expr_size -#line 649 "parser.ypp" +#line 653 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } #line 3201 "parser.cpp" break; case 154: // expr_primitive: expr_paren -#line 650 "parser.ypp" +#line 654 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } #line 3207 "parser.cpp" break; case 155: // expr_primitive: expr_empty_array -#line 651 "parser.ypp" +#line 655 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } #line 3213 "parser.cpp" break; case 156: // expr_primitive: expr_undefined -#line 652 "parser.ypp" +#line 656 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } #line 3219 "parser.cpp" break; case 157: // expr_primitive: expr_game -#line 653 "parser.ypp" +#line 657 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 3225 "parser.cpp" break; case 158: // expr_primitive: expr_self -#line 654 "parser.ypp" +#line 658 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 3231 "parser.cpp" break; case 159: // expr_primitive: expr_anim -#line 655 "parser.ypp" +#line 659 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 3237 "parser.cpp" break; case 160: // expr_primitive: expr_level -#line 656 "parser.ypp" +#line 660 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 3243 "parser.cpp" break; case 161: // expr_primitive: expr_animation -#line 657 "parser.ypp" +#line 661 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } #line 3249 "parser.cpp" break; case 162: // expr_primitive: expr_identifier -#line 658 "parser.ypp" +#line 662 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 3255 "parser.cpp" break; case 163: // expr_primitive: expr_istring -#line 659 "parser.ypp" +#line 663 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } #line 3261 "parser.cpp" break; case 164: // expr_primitive: expr_string -#line 660 "parser.ypp" +#line 664 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } #line 3267 "parser.cpp" break; case 165: // expr_primitive: expr_vector -#line 661 "parser.ypp" +#line 665 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } #line 3273 "parser.cpp" break; case 166: // expr_primitive: expr_hash -#line 662 "parser.ypp" +#line 666 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_hash::ptr > ()); } #line 3279 "parser.cpp" break; case 167: // expr_primitive: expr_float -#line 663 "parser.ypp" +#line 667 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } #line 3285 "parser.cpp" break; case 168: // expr_primitive: expr_integer -#line 664 "parser.ypp" +#line 668 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } #line 3291 "parser.cpp" break; case 169: // expr_primitive: expr_false -#line 665 "parser.ypp" +#line 669 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } #line 3297 "parser.cpp" break; case 170: // expr_primitive: expr_true -#line 666 "parser.ypp" +#line 670 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } #line 3303 "parser.cpp" break; case 171: // expr_complement: "~" expr -#line 671 "parser.ypp" +#line 675 "parser.ypp" { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 3309 "parser.cpp" break; case 172: // expr_not: "!" expr -#line 676 "parser.ypp" +#line 680 "parser.ypp" { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } #line 3315 "parser.cpp" break; case 173: // expr_call: expr_function -#line 680 "parser.ypp" +#line 684 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 3321 "parser.cpp" break; case 174: // expr_call: expr_pointer -#line 681 "parser.ypp" +#line 685 "parser.ypp" { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } #line 3327 "parser.cpp" break; case 175: // expr_method: expr_object expr_function -#line 684 "parser.ypp" +#line 688 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 3333 "parser.cpp" break; case 176: // expr_method: expr_object expr_pointer -#line 685 "parser.ypp" +#line 689 "parser.ypp" { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } #line 3339 "parser.cpp" break; case 177: // expr_function: expr_identifier "(" expr_arguments ")" -#line 690 "parser.ypp" +#line 694 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3345 "parser.cpp" break; case 178: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 692 "parser.ypp" +#line 696 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3351 "parser.cpp" break; case 179: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 694 "parser.ypp" +#line 698 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3357 "parser.cpp" break; case 180: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 696 "parser.ypp" +#line 700 "parser.ypp" { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3363 "parser.cpp" break; case 181: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 701 "parser.ypp" +#line 705 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } #line 3369 "parser.cpp" break; case 182: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 703 "parser.ypp" +#line 707 "parser.ypp" { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } #line 3375 "parser.cpp" break; case 183: // expr_parameters: expr_parameters "," expr_identifier -#line 708 "parser.ypp" +#line 712 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3381 "parser.cpp" break; case 184: // expr_parameters: expr_identifier -#line 710 "parser.ypp" +#line 714 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3387 "parser.cpp" break; case 185: // expr_parameters: %empty -#line 712 "parser.ypp" +#line 716 "parser.ypp" { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } #line 3393 "parser.cpp" break; case 186: // expr_arguments: expr_arguments_no_empty -#line 717 "parser.ypp" +#line 721 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } #line 3399 "parser.cpp" break; case 187: // expr_arguments: %empty -#line 719 "parser.ypp" +#line 723 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } #line 3405 "parser.cpp" break; case 188: // expr_arguments_no_empty: expr_arguments "," expr -#line 724 "parser.ypp" +#line 728 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ()); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3411 "parser.cpp" break; case 189: // expr_arguments_no_empty: expr -#line 726 "parser.ypp" +#line 730 "parser.ypp" { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } #line 3417 "parser.cpp" break; case 190: // expr_getnextarraykey: "getnextarraykey" "(" expr "," expr ")" -#line 731 "parser.ypp" +#line 735 "parser.ypp" { yylhs.value.as < ast::expr_getnextarraykey::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3423 "parser.cpp" break; case 191: // expr_getfirstarraykey: "getfirstarraykey" "(" expr ")" -#line 736 "parser.ypp" +#line 740 "parser.ypp" { yylhs.value.as < ast::expr_getfirstarraykey::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3429 "parser.cpp" break; case 192: // expr_getdvarcoloralpha: "getdvarcoloralpha" "(" expr ")" -#line 741 "parser.ypp" +#line 745 "parser.ypp" { yylhs.value.as < ast::expr_getdvarcoloralpha::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3435 "parser.cpp" break; case 193: // expr_getdvarcolorblue: "getdvarcolorblue" "(" expr ")" -#line 746 "parser.ypp" +#line 750 "parser.ypp" { yylhs.value.as < ast::expr_getdvarcolorblue::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3441 "parser.cpp" break; case 194: // expr_getdvarcolorgreen: "getdvarcolorgreen" "(" expr ")" -#line 751 "parser.ypp" +#line 755 "parser.ypp" { yylhs.value.as < ast::expr_getdvarcolorgreen::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3447 "parser.cpp" break; case 195: // expr_getdvarcolorred: "getdvarcolorred" "(" expr ")" -#line 756 "parser.ypp" +#line 760 "parser.ypp" { yylhs.value.as < ast::expr_getdvarcolorred::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3453 "parser.cpp" break; case 196: // expr_getdvarvector: "getdvarvector" "(" expr ")" -#line 761 "parser.ypp" +#line 765 "parser.ypp" { yylhs.value.as < ast::expr_getdvarvector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3459 "parser.cpp" break; case 197: // expr_getdvarfloat: "getdvarfloat" "(" expr ")" -#line 766 "parser.ypp" +#line 770 "parser.ypp" { yylhs.value.as < ast::expr_getdvarfloat::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3465 "parser.cpp" break; case 198: // expr_getdvarint: "getdvarint" "(" expr ")" -#line 771 "parser.ypp" +#line 775 "parser.ypp" { yylhs.value.as < ast::expr_getdvarint::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3471 "parser.cpp" break; case 199: // expr_getdvar: "getdvar" "(" expr ")" -#line 776 "parser.ypp" +#line 780 "parser.ypp" { yylhs.value.as < ast::expr_getdvar::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3477 "parser.cpp" break; case 200: // expr_gettime: "gettime" "(" ")" -#line 781 "parser.ypp" +#line 785 "parser.ypp" { yylhs.value.as < ast::expr_gettime::ptr > () = std::make_unique(yylhs.location); } #line 3483 "parser.cpp" break; case 201: // expr_abs: "abs" "(" expr ")" -#line 786 "parser.ypp" +#line 790 "parser.ypp" { yylhs.value.as < ast::expr_abs::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3489 "parser.cpp" break; case 202: // expr_vectortoangles: "vectortoangles" "(" expr ")" -#line 791 "parser.ypp" +#line 795 "parser.ypp" { yylhs.value.as < ast::expr_vectortoangles::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3495 "parser.cpp" break; case 203: // expr_angleclamp180: "angleclamp180" "(" expr ")" -#line 796 "parser.ypp" +#line 800 "parser.ypp" { yylhs.value.as < ast::expr_angleclamp180::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3501 "parser.cpp" break; case 204: // expr_anglestoforward: "anglestoforward" "(" expr ")" -#line 801 "parser.ypp" +#line 805 "parser.ypp" { yylhs.value.as < ast::expr_anglestoforward::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3507 "parser.cpp" break; case 205: // expr_anglestoright: "anglestoright" "(" expr ")" -#line 806 "parser.ypp" +#line 810 "parser.ypp" { yylhs.value.as < ast::expr_anglestoright::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3513 "parser.cpp" break; case 206: // expr_anglestoup: "anglestoup" "(" expr ")" -#line 811 "parser.ypp" +#line 815 "parser.ypp" { yylhs.value.as < ast::expr_anglestoup::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3519 "parser.cpp" break; case 207: // expr_vectorscale: "vectorscale" "(" expr "," expr ")" -#line 816 "parser.ypp" +#line 820 "parser.ypp" { yylhs.value.as < ast::expr_vectorscale::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3525 "parser.cpp" break; case 208: // expr_isdefined: "isdefined" "(" expr ")" -#line 821 "parser.ypp" +#line 825 "parser.ypp" { yylhs.value.as < ast::expr_isdefined::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3531 "parser.cpp" break; case 209: // expr_reference: "::" expr_identifier -#line 826 "parser.ypp" +#line 830 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3537 "parser.cpp" break; case 210: // expr_reference: expr_path "::" expr_identifier -#line 828 "parser.ypp" +#line 832 "parser.ypp" { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_path::ptr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3543 "parser.cpp" break; case 211: // expr_array: expr_object "[" expr "]" -#line 833 "parser.ypp" +#line 837 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3549 "parser.cpp" break; case 212: // expr_array: expr_getdvarvector "[" expr "]" -#line 835 "parser.ypp" +#line 839 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_getdvarvector::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3555 "parser.cpp" break; case 213: // expr_array: expr_vectortoangles "[" expr "]" -#line 837 "parser.ypp" +#line 841 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_vectortoangles::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3561 "parser.cpp" break; case 214: // expr_array: expr_angleclamp180 "[" expr "]" -#line 839 "parser.ypp" +#line 843 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_angleclamp180::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3567 "parser.cpp" break; case 215: // expr_array: expr_anglestoforward "[" expr "]" -#line 841 "parser.ypp" +#line 845 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_anglestoforward::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3573 "parser.cpp" break; case 216: // expr_array: expr_anglestoright "[" expr "]" -#line 843 "parser.ypp" +#line 847 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_anglestoright::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3579 "parser.cpp" break; case 217: // expr_array: expr_anglestoup "[" expr "]" -#line 845 "parser.ypp" +#line 849 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_anglestoup::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3585 "parser.cpp" break; case 218: // expr_array: expr_vectorscale "[" expr "]" -#line 847 "parser.ypp" +#line 851 "parser.ypp" { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_vectorscale::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3591 "parser.cpp" break; case 219: // expr_field: expr_object "." expr_identifier_nosize -#line 852 "parser.ypp" +#line 856 "parser.ypp" { yylhs.value.as < ast::expr_field::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } #line 3597 "parser.cpp" break; case 220: // expr_size: expr_object "." "size" -#line 857 "parser.ypp" +#line 861 "parser.ypp" { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } #line 3603 "parser.cpp" break; case 221: // expr_paren: "(" expr ")" -#line 862 "parser.ypp" +#line 866 "parser.ypp" { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } #line 3609 "parser.cpp" break; case 222: // expr_object: expr_call -#line 866 "parser.ypp" +#line 870 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } #line 3615 "parser.cpp" break; case 223: // expr_object: expr_method -#line 867 "parser.ypp" +#line 871 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } #line 3621 "parser.cpp" break; case 224: // expr_object: expr_array -#line 868 "parser.ypp" +#line 872 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } #line 3627 "parser.cpp" break; case 225: // expr_object: expr_field -#line 869 "parser.ypp" +#line 873 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } #line 3633 "parser.cpp" break; case 226: // expr_object: expr_game -#line 870 "parser.ypp" +#line 874 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } #line 3639 "parser.cpp" break; case 227: // expr_object: expr_self -#line 871 "parser.ypp" +#line 875 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } #line 3645 "parser.cpp" break; case 228: // expr_object: expr_anim -#line 872 "parser.ypp" +#line 876 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } #line 3651 "parser.cpp" break; case 229: // expr_object: expr_level -#line 873 "parser.ypp" +#line 877 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } #line 3657 "parser.cpp" break; case 230: // expr_object: expr_identifier -#line 874 "parser.ypp" +#line 878 "parser.ypp" { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } #line 3663 "parser.cpp" break; case 231: // expr_empty_array: "[" "]" -#line 879 "parser.ypp" +#line 883 "parser.ypp" { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } #line 3669 "parser.cpp" break; case 232: // expr_undefined: "undefined" -#line 884 "parser.ypp" +#line 888 "parser.ypp" { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } #line 3675 "parser.cpp" break; case 233: // expr_game: "game" -#line 889 "parser.ypp" +#line 893 "parser.ypp" { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } #line 3681 "parser.cpp" break; case 234: // expr_self: "self" -#line 894 "parser.ypp" +#line 898 "parser.ypp" { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } #line 3687 "parser.cpp" break; case 235: // expr_anim: "anim" -#line 899 "parser.ypp" +#line 903 "parser.ypp" { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } #line 3693 "parser.cpp" break; case 236: // expr_level: "level" -#line 904 "parser.ypp" +#line 908 "parser.ypp" { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } #line 3699 "parser.cpp" break; case 237: // expr_animation: "%" "identifier" -#line 909 "parser.ypp" +#line 913 "parser.ypp" { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3705 "parser.cpp" break; case 238: // expr_identifier_nosize: "identifier" -#line 914 "parser.ypp" +#line 918 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3711 "parser.cpp" break; case 239: // expr_identifier: "identifier" -#line 919 "parser.ypp" +#line 923 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3717 "parser.cpp" break; case 240: // expr_identifier: "size" -#line 921 "parser.ypp" +#line 925 "parser.ypp" { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } #line 3723 "parser.cpp" break; case 241: // expr_path: "identifier" -#line 926 "parser.ypp" +#line 930 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3729 "parser.cpp" break; case 242: // expr_path: "path" -#line 928 "parser.ypp" +#line 932 "parser.ypp" { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3735 "parser.cpp" break; case 243: // expr_istring: "localized string" -#line 933 "parser.ypp" +#line 937 "parser.ypp" { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3741 "parser.cpp" break; case 244: // expr_string: "string literal" -#line 938 "parser.ypp" +#line 942 "parser.ypp" { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3747 "parser.cpp" break; case 245: // expr_vector: "(" expr "," expr "," expr ")" -#line 943 "parser.ypp" +#line 947 "parser.ypp" { yylhs.value.as < ast::expr_vector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } #line 3753 "parser.cpp" break; case 246: // expr_hash: "hash" -#line 948 "parser.ypp" +#line 952 "parser.ypp" { yylhs.value.as < ast::expr_hash::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3759 "parser.cpp" break; case 247: // expr_float: "-" "float" -#line 953 "parser.ypp" +#line 957 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3765 "parser.cpp" break; case 248: // expr_float: "float" -#line 955 "parser.ypp" +#line 959 "parser.ypp" { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3771 "parser.cpp" break; case 249: // expr_integer: "-" "integer" -#line 960 "parser.ypp" +#line 964 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } #line 3777 "parser.cpp" break; case 250: // expr_integer: "integer" -#line 962 "parser.ypp" +#line 966 "parser.ypp" { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } #line 3783 "parser.cpp" break; case 251: // expr_false: "false" -#line 967 "parser.ypp" +#line 971 "parser.ypp" { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } #line 3789 "parser.cpp" break; case 252: // expr_true: "true" -#line 972 "parser.ypp" +#line 976 "parser.ypp" { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } #line 3795 "parser.cpp" break; @@ -4068,6 +4068,8 @@ namespace xsk { namespace arc { namespace t6 { } + + bool parser::yy_lac_check_ (symbol_kind_type yytoken) const { @@ -4172,7 +4174,9 @@ namespace xsk { namespace arc { namespace t6 { follows. If no initial context is currently established for the current lookahead, then check if that lookahead can eventually be shifted if syntactic actions continue from the current context. */ - if (!yy_lac_established_) + if (yy_lac_established_) + return true; + else { #if T6DEBUG YYCDEBUG << "LAC: initial context established for " @@ -4181,12 +4185,11 @@ namespace xsk { namespace arc { namespace t6 { yy_lac_established_ = true; return yy_lac_check_ (yytoken); } - return true; } // Discard any previous initial lookahead context. void - parser::yy_lac_discard_ (const char* evt) + parser::yy_lac_discard_ (const char* event) { /* Discard any previous initial lookahead context because of Event, which may be a lookahead change or an invalidation of the currently @@ -4202,11 +4205,12 @@ namespace xsk { namespace arc { namespace t6 { if (yy_lac_established_) { YYCDEBUG << "LAC: initial context discarded due to " - << evt << '\n'; + << event << '\n'; yy_lac_established_ = false; } } + int parser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -5257,32 +5261,32 @@ namespace xsk { namespace arc { namespace t6 { const short parser::yyrline_[] = { - 0, 283, 283, 284, 288, 290, 292, 294, 296, 298, - 303, 307, 312, 313, 314, 315, 316, 320, 325, 330, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 361, 362, 366, 368, 373, 375, 380, - 381, 385, 386, 390, 392, 394, 397, 401, 403, 408, - 410, 412, 417, 422, 424, 429, 434, 436, 441, 443, - 448, 453, 458, 463, 468, 473, 478, 480, 485, 490, - 492, 497, 502, 507, 512, 514, 519, 524, 529, 530, - 531, 535, 536, 540, 542, 544, 546, 548, 550, 552, - 554, 556, 558, 560, 565, 567, 572, 574, 579, 584, - 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, - 606, 608, 610, 612, 614, 616, 618, 623, 624, 625, - 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, - 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, - 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, - 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 670, 675, 680, 681, 684, 685, 689, 691, 693, - 695, 700, 702, 707, 709, 712, 716, 719, 723, 725, - 730, 735, 740, 745, 750, 755, 760, 765, 770, 775, - 780, 785, 790, 795, 800, 805, 810, 815, 820, 825, - 827, 832, 834, 836, 838, 840, 842, 844, 846, 851, - 856, 861, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 878, 883, 888, 893, 898, 903, 908, 913, 918, - 920, 925, 927, 932, 937, 942, 947, 952, 954, 959, - 961, 966, 971 + 0, 287, 287, 288, 292, 294, 296, 298, 300, 302, + 307, 311, 316, 317, 318, 319, 320, 324, 329, 334, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, 361, 365, 366, 370, 372, 377, 379, 384, + 385, 389, 390, 394, 396, 398, 401, 405, 407, 412, + 414, 416, 421, 426, 428, 433, 438, 440, 445, 447, + 452, 457, 462, 467, 472, 477, 482, 484, 489, 494, + 496, 501, 506, 511, 516, 518, 523, 528, 533, 534, + 535, 539, 540, 544, 546, 548, 550, 552, 554, 556, + 558, 560, 562, 564, 569, 571, 576, 578, 583, 588, + 590, 592, 594, 596, 598, 600, 602, 604, 606, 608, + 610, 612, 614, 616, 618, 620, 622, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, + 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, + 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, + 670, 674, 679, 684, 685, 688, 689, 693, 695, 697, + 699, 704, 706, 711, 713, 716, 720, 723, 727, 729, + 734, 739, 744, 749, 754, 759, 764, 769, 774, 779, + 784, 789, 794, 799, 804, 809, 814, 819, 824, 829, + 831, 836, 838, 840, 842, 844, 846, 848, 850, 855, + 860, 865, 870, 871, 872, 873, 874, 875, 876, 877, + 878, 882, 887, 892, 897, 902, 907, 912, 917, 922, + 924, 929, 931, 936, 941, 946, 951, 956, 958, 963, + 965, 970, 975 }; void @@ -5315,9 +5319,9 @@ namespace xsk { namespace arc { namespace t6 { #line 13 "parser.ypp" } } } // xsk::arc::t6 -#line 5319 "parser.cpp" +#line 5323 "parser.cpp" -#line 975 "parser.ypp" +#line 979 "parser.ypp" void xsk::arc::t6::parser::error(const xsk::arc::location& loc, const std::string& msg) diff --git a/src/t6/xsk/parser.hpp b/src/t6/xsk/parser.hpp index b71a6c4e..59d0d686 100644 --- a/src/t6/xsk/parser.hpp +++ b/src/t6/xsk/parser.hpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.7.5. +// A Bison parser, made by GNU Bison 3.8.2. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -15,7 +15,7 @@ // GNU General Public License for more details. // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // part or all of the Bison parser skeleton and distribute that work @@ -47,10 +47,14 @@ // "%code requires" blocks. #line 28 "parser.ypp" +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif #include "t6.hpp" namespace xsk::arc::t6 { class lexer; } -#line 54 "parser.hpp" +#line 58 "parser.hpp" # include # include // std::abort @@ -126,12 +130,18 @@ namespace xsk::arc::t6 { class lexer; } # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -193,7 +203,7 @@ namespace xsk::arc::t6 { class lexer; } #line 13 "parser.ypp" namespace xsk { namespace arc { namespace t6 { -#line 197 "parser.hpp" +#line 207 "parser.hpp" @@ -202,27 +212,32 @@ namespace xsk { namespace arc { namespace t6 { class parser { public: -#ifndef T6STYPE +#ifdef T6STYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define T6STYPE in C++, use %define api.value.type" +# endif + typedef T6STYPE value_type; +#else /// A buffer to store and retrieve objects. /// /// Sort of a variant, but does not keep track of the nature /// of the stored data, since that knowledge is available /// via the current parser state. - class semantic_type + class value_type { public: /// Type of *this. - typedef semantic_type self_type; + typedef value_type self_type; /// Empty construction. - semantic_type () YY_NOEXCEPT - : yybuffer_ () + value_type () YY_NOEXCEPT + : yyraw_ () , yytypeid_ (YY_NULLPTR) {} /// Construct and fill. template - semantic_type (YY_RVREF (T) t) + value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { T6_ASSERT (sizeof (T) <= size); @@ -231,13 +246,13 @@ namespace xsk { namespace arc { namespace t6 { #if 201103L <= YY_CPLUSPLUS /// Non copyable. - semantic_type (const self_type&) = delete; + value_type (const self_type&) = delete; /// Non copyable. self_type& operator= (const self_type&) = delete; #endif /// Destruction, allowed only if empty. - ~semantic_type () YY_NOEXCEPT + ~value_type () YY_NOEXCEPT { T6_ASSERT (!yytypeid_); } @@ -381,7 +396,7 @@ namespace xsk { namespace arc { namespace t6 { private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - semantic_type (const self_type&); + value_type (const self_type&); /// Non copyable. self_type& operator= (const self_type&); #endif @@ -391,7 +406,7 @@ namespace xsk { namespace arc { namespace t6 { T* yyas_ () YY_NOEXCEPT { - void *yyp = yybuffer_.yyraw; + void *yyp = yyraw_; return static_cast (yyp); } @@ -400,7 +415,7 @@ namespace xsk { namespace arc { namespace t6 { const T* yyas_ () const YY_NOEXCEPT { - const void *yyp = yybuffer_.yyraw; + const void *yyp = yyraw_; return static_cast (yyp); } @@ -681,18 +696,19 @@ namespace xsk { namespace arc { namespace t6 { union { /// Strongest alignment constraints. - long double yyalign_me; + long double yyalign_me_; /// A buffer large enough to store any of the semantic values. - char yyraw[size]; - } yybuffer_; + char yyraw_[size]; + }; /// Whether the content is built: if defined, the name of the stored type. const std::type_info *yytypeid_; }; -#else - typedef T6STYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Symbol locations. typedef xsk::arc::location location_type; @@ -852,7 +868,7 @@ namespace xsk { namespace arc { namespace t6 { }; /// Token kind, as returned by yylex. - typedef token::yytokentype token_kind_type; + typedef token::token_kind_type token_kind_type; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type token_type; @@ -1110,7 +1126,7 @@ namespace xsk { namespace arc { namespace t6 { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () , location () {} @@ -2649,6 +2665,8 @@ namespace xsk { namespace arc { namespace t6 { clear (); } + + /// Destroy contents, and record that is empty. void clear () YY_NOEXCEPT { @@ -3036,7 +3054,7 @@ switch (yykind) void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; /// The location. location_type location; @@ -3051,22 +3069,24 @@ switch (yykind) /// Type access provider for token (enum) based symbols. struct by_kind { - /// Default constructor. - by_kind (); - -#if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind (by_kind&& that); -#endif - - /// Copy constructor. - by_kind (const by_kind& that); - /// The symbol kind as needed by the constructor. typedef token_kind_type kind_type; + /// Default constructor. + by_kind () YY_NOEXCEPT; + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that) YY_NOEXCEPT; +#endif + + /// Copy constructor. + by_kind (const by_kind& that) YY_NOEXCEPT; + /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. void clear () YY_NOEXCEPT; @@ -3096,30 +3116,34 @@ switch (yykind) typedef basic_symbol super_type; /// Empty symbol. - symbol_type () {} + symbol_type () YY_NOEXCEPT {} /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, location_type l) - : super_type(token_type (tok), std::move (l)) + : super_type (token_kind_type (tok), std::move (l)) #else symbol_type (int tok, const location_type& l) - : super_type(token_type (tok), l) + : super_type (token_kind_type (tok), l) #endif { +#if !defined _MSC_VER || defined __clang__ T6_ASSERT (tok == token::T6EOF || (token::T6error <= tok && tok <= token::MOD) || (token::SIZEOF <= tok && tok <= token::POSTDEC)); +#endif } #if 201103L <= YY_CPLUSPLUS symbol_type (int tok, std::string v, location_type l) - : super_type(token_type (tok), std::move (v), std::move (l)) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else symbol_type (int tok, const std::string& v, const location_type& l) - : super_type(token_type (tok), v, l) + : super_type (token_kind_type (tok), v, l) #endif { +#if !defined _MSC_VER || defined __clang__ T6_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); +#endif } }; @@ -3168,7 +3192,7 @@ switch (yykind) /// YYSYMBOL. No bounds checking. static const char *symbol_name (symbol_kind_type yysymbol); - // Implementation of make_symbol for each symbol type. + // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -5115,19 +5139,19 @@ switch (yykind) /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const short yypact_ninf_; static const short yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; @@ -5154,14 +5178,14 @@ switch (yykind) static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. static const unsigned char yystos_[]; - // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. static const unsigned char yyr1_[]; - // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; @@ -5260,7 +5284,7 @@ switch (yykind) typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -5339,7 +5363,7 @@ switch (yykind) class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -5398,7 +5422,7 @@ switch (yykind) void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum @@ -5417,7 +5441,7 @@ switch (yykind) inline parser::symbol_kind_type - parser::yytranslate_ (int t) + parser::yytranslate_ (int t) YY_NOEXCEPT { return static_cast (t); } @@ -5787,6 +5811,7 @@ switch (yykind) + template parser::symbol_kind_type parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -5794,6 +5819,7 @@ switch (yykind) return this->kind (); } + template bool parser::basic_symbol::empty () const YY_NOEXCEPT @@ -6165,13 +6191,13 @@ switch (yykind) // by_kind. inline - parser::by_kind::by_kind () + parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #if 201103L <= YY_CPLUSPLUS inline - parser::by_kind::by_kind (by_kind&& that) + parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT : kind_ (that.kind_) { that.clear (); @@ -6179,15 +6205,17 @@ switch (yykind) #endif inline - parser::by_kind::by_kind (const by_kind& that) + parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : kind_ (that.kind_) {} inline - parser::by_kind::by_kind (token_kind_type t) + parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT : kind_ (yytranslate_ (t)) {} + + inline void parser::by_kind::clear () YY_NOEXCEPT @@ -6210,6 +6238,7 @@ switch (yykind) return kind_; } + inline parser::symbol_kind_type parser::by_kind::type_get () const YY_NOEXCEPT @@ -6217,9 +6246,10 @@ switch (yykind) return this->kind (); } + #line 13 "parser.ypp" } } } // xsk::arc::t6 -#line 6223 "parser.hpp" +#line 6253 "parser.hpp" diff --git a/src/t6/xsk/resolver.cpp b/src/t6/xsk/resolver.cpp index 9eca3692..7bcf2fee 100644 --- a/src/t6/xsk/resolver.cpp +++ b/src/t6/xsk/resolver.cpp @@ -6,6 +6,11 @@ #include "stdafx.hpp" #include "t6.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4244) +#endif + namespace xsk::arc::t6 { @@ -3637,3 +3642,7 @@ struct __init__ __init__ _; } // namespace xsk::arc::t6 + +#ifdef _MSC_VER +#pragma warning(pop) +#endif diff --git a/src/tool/stdafx.hpp b/src/tool/stdafx.hpp index 879285ee..19f22f43 100644 --- a/src/tool/stdafx.hpp +++ b/src/tool/stdafx.hpp @@ -5,36 +5,22 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4005) -#pragma warning(disable:4018) -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4389) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include -// Ext using namespace std::literals; diff --git a/src/tool/xsk/main.cpp b/src/tool/xsk/main.cpp index de1318fb..a4455f95 100644 --- a/src/tool/xsk/main.cpp +++ b/src/tool/xsk/main.cpp @@ -4,7 +4,6 @@ // that can be found in the LICENSE file. #include "stdafx.hpp" - #include "utils/xsk/utils.hpp" #include "iw5/xsk/iw5.hpp" #include "iw6/xsk/iw6.hpp" @@ -157,9 +156,9 @@ void assemble_file(game game, std::string file) script.name = file; script.bytecode = assembler.output_script(); script.buffer = std::move(compressed); - script.len = uncompressed.size(); - script.compressedLen = script.buffer.size(); - script.bytecodeLen = script.bytecode.size(); + script.len = static_cast(uncompressed.size()); + script.compressedLen = static_cast(script.buffer.size()); + script.bytecodeLen = static_cast(script.bytecode.size()); auto output = script.serialize(); utils::file::save("assembled/" + file + ".gscbin", output); @@ -295,9 +294,9 @@ void compile_file(game game, std::string file) script.name = file; script.bytecode = assembler.output_script(); script.buffer = std::move(compressed); - script.len = uncompressed.size(); - script.compressedLen = script.buffer.size(); - script.bytecodeLen = script.bytecode.size(); + script.len = static_cast(uncompressed.size()); + script.compressedLen = static_cast(script.buffer.size()); + script.bytecodeLen = static_cast(script.bytecode.size()); auto output = script.serialize(); utils::file::save("compiled/" + file + ".gscbin", output); diff --git a/src/utils/stdafx.hpp b/src/utils/stdafx.hpp index de8f41e8..291c730d 100644 --- a/src/utils/stdafx.hpp +++ b/src/utils/stdafx.hpp @@ -5,37 +5,24 @@ #pragma once -// Warnings -#ifdef _WIN32 -#pragma warning(disable:4005) -#pragma warning(disable:4018) -#pragma warning(disable:4065) -#pragma warning(disable:4127) -#pragma warning(disable:4244) -#pragma warning(disable:4267) -#pragma warning(disable:4389) -#define _CRT_SECURE_NO_WARNINGS -#endif - -// C/C++ -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include -// Ext using namespace std::literals; #include "xsk/utils.hpp" diff --git a/src/utils/xsk/gsc/asset.cpp b/src/utils/xsk/gsc/asset.cpp index e719e750..e16ebf85 100644 --- a/src/utils/xsk/gsc/asset.cpp +++ b/src/utils/xsk/gsc/asset.cpp @@ -15,7 +15,7 @@ auto asset::serialize() -> std::vector data.resize(name.size() + compressedLen + bytecodeLen + 13); std::memset(data.data(), 0, data.size()); - auto pos = 0u; + std::size_t pos = 0; std::memcpy(&data[pos], name.data(), name.size() + 1); pos += name.size() + 1; @@ -39,7 +39,7 @@ auto asset::serialize() -> std::vector void asset::deserialize(std::vector data) { - auto pos = 0u; + std::size_t pos = 0; name = std::string(reinterpret_cast(data.data())); pos += name.size() + 1; diff --git a/src/utils/xsk/gsc/block.cpp b/src/utils/xsk/gsc/block.cpp index 2456d622..3b4ab369 100644 --- a/src/utils/xsk/gsc/block.cpp +++ b/src/utils/xsk/gsc/block.cpp @@ -87,7 +87,7 @@ void block::merge(const std::vector& childs) { auto child = childs[childidx]; - child->local_vars_public_count = this->local_vars.size(); + child->local_vars_public_count = static_cast(this->local_vars.size()); for (std::size_t i = 0; i < this->local_vars.size(); i++ ) { auto& name = this->local_vars.at(i).name; @@ -147,7 +147,7 @@ auto block::find_variable(std::size_t start, const std::string& name) -> std::in for (std::size_t i = start; i < local_vars.size(); ++i ) { if (local_vars.at(i).name == name) - return i; + return static_cast(i); } return -1; } @@ -159,14 +159,14 @@ void block::transfer_decompiler(const block::ptr& child) child->local_vars.push_back(this->local_vars.at(i)); } - child->local_vars_public_count = this->local_vars.size(); + child->local_vars_public_count = static_cast(this->local_vars.size()); } void block::append_decompiler(const block::ptr& child, bool all) { auto total = all ? child->local_vars.size() : child->local_vars_public_count; - for (std::uint32_t i = this->local_vars.size(); i < total; i++ ) + for (auto i = this->local_vars.size(); i < total; i++ ) { this->local_vars.push_back(child->local_vars.at(i)); } diff --git a/src/utils/xsk/utils.hpp b/src/utils/xsk/utils.hpp index 20d1f652..4770a504 100644 --- a/src/utils/xsk/utils.hpp +++ b/src/utils/xsk/utils.hpp @@ -5,20 +5,17 @@ #pragma once -// Utility #include "utils/file.hpp" #include "utils/string.hpp" #include "utils/byte_buffer.hpp" #include "utils/compression.hpp" -// GSC Types #include "gsc/location.hpp" #include "gsc/types.hpp" #include "gsc/asset.hpp" #include "gsc/block.hpp" #include "gsc/nodetree.hpp" -// GSC Interfaces #include "gsc/interfaces/exception.hpp" #include "gsc/interfaces/assembler.hpp" #include "gsc/interfaces/disassembler.hpp" @@ -26,13 +23,11 @@ #include "gsc/interfaces/decompiler.hpp" #include "gsc/interfaces/context.hpp" -// ARC Types #include "arc/location.hpp" #include "arc/types.hpp" #include "arc/block.hpp" #include "arc/nodetree.hpp" -// ARC Interfaces #include "arc/interfaces/exception.hpp" #include "arc/interfaces/assembler.hpp" #include "arc/interfaces/disassembler.hpp" diff --git a/src/utils/xsk/utils/byte_buffer.cpp b/src/utils/xsk/utils/byte_buffer.cpp index a18ed456..b58a72e1 100644 --- a/src/utils/xsk/utils/byte_buffer.cpp +++ b/src/utils/xsk/utils/byte_buffer.cpp @@ -10,16 +10,16 @@ namespace xsk::utils byte_buffer::byte_buffer() { - data_.resize(0x1000000); - std::fill(data_.begin(), data_.end(), 0); - size_ = data_.size(); + data_.resize(0x100000); + std::fill(data_.begin(), data_.end(), '\0'); + size_ = static_cast(data_.size()); pos_ = 0; } -byte_buffer::byte_buffer(std::size_t size) +byte_buffer::byte_buffer(std::uint32_t size) { data_.resize(size); - std::fill(data_.begin(), data_.end(), 0); + std::fill(data_.begin(), data_.end(), '\0'); size_ = size; pos_ = 0; } @@ -27,56 +27,61 @@ byte_buffer::byte_buffer(std::size_t size) byte_buffer::byte_buffer(const std::vector& data) { data_ = data; - size_ = data.size(); + size_ = static_cast(data_.size()); pos_ = 0; } byte_buffer::~byte_buffer() { data_.clear(); + size_ = 0; pos_ = 0; } void byte_buffer::clear() { - std::fill(data_.begin(), data_.end(), 0); + std::fill(data_.begin(), data_.end(), '\0'); } auto byte_buffer::is_avail() -> bool { - if (pos_ < data_.size()) return true; - return false; + return (pos_ < size_) ? true : false; } -void byte_buffer::seek(std::size_t pos) +void byte_buffer::seek(std::uint32_t count) { - pos_ += pos; + pos_ += count; } -void byte_buffer::seek_neg(std::size_t pos) + +void byte_buffer::seek_neg(std::uint32_t count) { - pos_ -= pos; + pos_ -= count; } void byte_buffer::write_string(const std::string& data) { - strcpy(reinterpret_cast(data_.data() + pos_), data.data()); - pos_ += data.size(); + if (pos_ + data.size() > size_) return; + + std::memcpy(reinterpret_cast(data_.data() + pos_), data.data(), data.size()); + pos_ += static_cast(data.size()); } void byte_buffer::write_c_string(const std::string& data) { - strcpy(reinterpret_cast(data_.data() + pos_), data.data()); - pos_ += data.size() + 1; + if (pos_ + data.size() >= size_) return; + + std::memcpy(reinterpret_cast(data_.data() + pos_), data.data(), data.size()); + pos_ += static_cast(data.size() + 1); } auto byte_buffer::read_c_string() -> std::string { auto ret = std::string(reinterpret_cast(data_.data() + pos_)); - pos_ += ret.size() + 1; + pos_ += static_cast(ret.size() + 1); return ret; } -auto byte_buffer::print_bytes(std::size_t pos, std::size_t count) -> std::string +auto byte_buffer::print_bytes(std::uint32_t pos, std::uint32_t count) -> std::string { std::string data {}; @@ -88,12 +93,12 @@ auto byte_buffer::print_bytes(std::size_t pos, std::size_t count) -> std::string return data; } -auto byte_buffer::pos() -> std::size_t +auto byte_buffer::pos() -> std::uint32_t { return pos_; } -void byte_buffer::pos(std::size_t pos) +void byte_buffer::pos(std::uint32_t pos) { if (pos >= 0 && pos <= size_) { @@ -101,7 +106,7 @@ void byte_buffer::pos(std::size_t pos) } } -auto byte_buffer::align(std::size_t size) -> std::size_t +auto byte_buffer::align(std::uint32_t size) -> std::uint32_t { auto pos = pos_; diff --git a/src/utils/xsk/utils/byte_buffer.hpp b/src/utils/xsk/utils/byte_buffer.hpp index 101f77cf..0ed671ae 100644 --- a/src/utils/xsk/utils/byte_buffer.hpp +++ b/src/utils/xsk/utils/byte_buffer.hpp @@ -15,18 +15,20 @@ public: private: std::vector data_; - std::size_t size_; - std::size_t pos_; + std::uint32_t size_; + std::uint32_t pos_; public: byte_buffer(); - byte_buffer(std::size_t size); + byte_buffer(std::uint32_t size); byte_buffer(const std::vector& data); ~byte_buffer(); template auto read() -> T { + if (pos_ + sizeof(T) > size_) return T{}; + auto ret = *reinterpret_cast(data_.data() + pos_); pos_ += sizeof(T); return ret; @@ -35,6 +37,8 @@ public: template void write(T data) { + if (pos_ + sizeof(T) > size_) return; + T* mem = reinterpret_cast(data_.data() + pos_); std::memcpy(mem, &data, sizeof(T)); pos_ += sizeof(T); @@ -43,6 +47,8 @@ public: template auto read_endian() -> T { + if (pos_ + sizeof(T) > size_) return T{}; + std::array mem; for (auto i = 0; i < sizeof(T); i++) @@ -58,6 +64,8 @@ public: template void write_endian(T data) { + if (pos_ + sizeof(T) > size_) return; + auto* mem = data_.data() + pos_; for (auto i = 0; i < sizeof(T); i++) @@ -70,15 +78,15 @@ public: void clear(); auto is_avail() -> bool; - void seek(std::size_t pos); - void seek_neg(std::size_t pos); + void seek(std::uint32_t count); + void seek_neg(std::uint32_t count); void write_string(const std::string& data); void write_c_string(const std::string& data); auto read_c_string() -> std::string; - auto print_bytes(std::size_t pos, std::size_t count) -> std::string; - auto pos() -> std::size_t; - void pos(std::size_t pos); - auto align(std::size_t size) -> std::size_t; + auto print_bytes(std::uint32_t pos, std::uint32_t count) -> std::string; + auto pos() -> std::uint32_t; + void pos(std::uint32_t pos); + auto align(std::uint32_t size) -> std::uint32_t; auto buffer() -> std::vector&; }; diff --git a/src/utils/xsk/utils/compression.cpp b/src/utils/xsk/utils/compression.cpp index 3763e0af..e66dd2ed 100644 --- a/src/utils/xsk/utils/compression.cpp +++ b/src/utils/xsk/utils/compression.cpp @@ -30,7 +30,7 @@ auto zlib::decompress(const std::vector& data, std::uint32_t lengt std::vector output; output.resize(length); - auto result = uncompress(output.data(), (uLongf*)&length, (Bytef*)data.data(), data.size()); + auto result = uncompress(reinterpret_cast(output.data()), reinterpret_cast(&length), reinterpret_cast(data.data()), static_cast(data.size())); if (result != Z_OK) return {}; diff --git a/src/utils/xsk/utils/string.cpp b/src/utils/xsk/utils/string.cpp index 58e148aa..8196de79 100644 --- a/src/utils/xsk/utils/string.cpp +++ b/src/utils/xsk/utils/string.cpp @@ -48,7 +48,7 @@ auto string::to_lower(const std::string& input) -> std::string for (std::size_t i = 0; i < data.size(); i++) { - data[i] = std::tolower(input[i]); + data[i] = static_cast(std::tolower(static_cast(input[i]))); } return data; @@ -271,7 +271,7 @@ auto string::float_string(float value) -> std::string while (i < str.size()) p_exp.push_back(str[i++]); - auto offset = std::stoi(p_exp); + std::size_t offset = std::stoi(p_exp); if ((flags & exp_neg)) offset -= p_int.size(); @@ -303,7 +303,7 @@ auto string::float_string(float value) -> std::string while (i < str.size()) p_exp.push_back(str[i++]); - auto offset = std::stoi(p_exp); + std::size_t offset = std::stoi(p_exp); offset -= (flags & exp_neg) ? p_int.size() : p_dec.size();