diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/elna/boot/ast.h | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/include/elna/boot/ast.h b/include/elna/boot/ast.h index 4a0cdb0..6a3b9c9 100644 --- a/include/elna/boot/ast.h +++ b/include/elna/boot/ast.h @@ -163,15 +163,14 @@ namespace elna::boot /// Scope containing the variables, entered by the name analysis. std::shared_ptr<symbol_table> symbols; - block() = default; block(std::vector<variable_declaration *>&& variables, std::vector<statement *>&& statements); block(const block&) = delete; block(block&& that) noexcept = default; block& operator=(const block&) = delete; - block& operator=(block&& that) noexcept = default; + block& operator=(block&& that) noexcept; - ~block(); + virtual ~block(); }; /** @@ -380,7 +379,7 @@ namespace elna::boot { attribute(identifier&& name, std::vector<expression *> arguments); attribute(const attribute&) = delete; - attribute(attribute&& that) noexcept; + attribute(attribute&& that) noexcept = default; ~attribute(); attribute& operator=(const attribute& that) = delete; @@ -401,6 +400,11 @@ namespace elna::boot { identifier_definition(const std::string& name, const source_position& position, const bool exported, std::vector<attribute>&& attributes = std::vector<attribute>{}); + identifier_definition(const identifier_definition&) = delete; + identifier_definition(identifier_definition&&) noexcept = default; + + identifier_definition& operator=(const identifier_definition&) = delete; + identifier_definition& operator=(identifier_definition&&) noexcept = default; const std::string& name() const; const identifier& id() const; @@ -688,9 +692,12 @@ namespace elna::boot expression *return_expression{ nullptr }; explicit procedure_body(block&& body, expression *return_expression = nullptr); - procedure_body(procedure_body&& that) noexcept = default; + procedure_body(const procedure_body&) = delete; + procedure_body(procedure_body&& that) noexcept; + ~procedure_body() override; - virtual ~procedure_body() = default; + procedure_body& operator=(const procedure_body&) = delete; + procedure_body& operator=(procedure_body&& that) noexcept; }; void traverse_body(parser_visitor *visitor, const procedure_body& body); @@ -791,16 +798,30 @@ namespace elna::boot block body; conditional_statements(expression *prerequisite, block&& body); + conditional_statements(const conditional_statements&) = delete; + conditional_statements(conditional_statements&& that) noexcept; + + conditional_statements& operator=(const conditional_statements&) = delete; + conditional_statements& operator=(conditional_statements&& that) noexcept; expression& prerequisite(); - virtual ~conditional_statements(); + ~conditional_statements(); }; struct switch_case { std::vector<expression *> labels; block body; + + switch_case(std::vector<expression *>&& labels, block&& body); + switch_case(const switch_case&) = delete; + switch_case(switch_case&& that) noexcept = default; + + switch_case& operator=(const switch_case&) = delete; + switch_case& operator=(switch_case&& that) noexcept; + + ~switch_case(); }; class case_statement : public statement @@ -983,11 +1004,11 @@ namespace elna::boot conditional_statements *m_branch; public: - const std::vector<conditional_statements *> branches; + std::vector<conditional_statements> branches; block *alternative; if_statement(const source_position position, conditional_statements *branch, - std::vector<conditional_statements *>&& branches, + std::vector<conditional_statements>&& branches, block *alternative = nullptr); void accept(parser_visitor *visitor) override; @@ -1016,10 +1037,10 @@ namespace elna::boot conditional_statements *m_branch; public: - const std::vector<conditional_statements *> branches; + std::vector<conditional_statements> branches; while_statement(const source_position position, conditional_statements *branch, - std::vector<conditional_statements *>&& branches); + std::vector<conditional_statements>&& branches); void accept(parser_visitor *visitor) override; conditional_statements& branch(); |
