aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/elna/boot/ast.h (renamed from include/elna/frontend/ast.h)6
-rw-r--r--include/elna/boot/dependency.h (renamed from include/elna/frontend/dependency.h)8
-rw-r--r--include/elna/boot/driver.h (renamed from include/elna/frontend/driver.h)4
-rw-r--r--include/elna/boot/result.h (renamed from include/elna/frontend/result.h)6
-rw-r--r--include/elna/boot/semantic.h (renamed from include/elna/frontend/semantic.h)8
-rw-r--r--include/elna/boot/symbol.h (renamed from include/elna/frontend/symbol.h)4
-rw-r--r--include/elna/gcc/elna-builtins.h10
-rw-r--r--include/elna/gcc/elna-diagnostic.h6
-rw-r--r--include/elna/gcc/elna-generic.h92
-rw-r--r--include/elna/gcc/elna-tree.h12
10 files changed, 78 insertions, 78 deletions
diff --git a/include/elna/frontend/ast.h b/include/elna/boot/ast.h
index 0b5f3d7..7d94e84 100644
--- a/include/elna/frontend/ast.h
+++ b/include/elna/boot/ast.h
@@ -22,10 +22,10 @@ along with GCC; see the file COPYING3. If not see
#include <string>
#include <vector>
#include <optional>
-#include "elna/frontend/symbol.h"
-#include "elna/frontend/result.h"
+#include "elna/boot/symbol.h"
+#include "elna/boot/result.h"
-namespace elna::frontend
+namespace elna::boot
{
enum class binary_operator
{
diff --git a/include/elna/frontend/dependency.h b/include/elna/boot/dependency.h
index f1502d1..4ec4d44 100644
--- a/include/elna/frontend/dependency.h
+++ b/include/elna/boot/dependency.h
@@ -19,11 +19,11 @@ along with GCC; see the file COPYING3. If not see
#include <filesystem>
#include <fstream>
-#include "elna/frontend/result.h"
-#include "elna/frontend/ast.h"
-#include "elna/frontend/symbol.h"
+#include "elna/boot/result.h"
+#include "elna/boot/ast.h"
+#include "elna/boot/symbol.h"
-namespace elna::frontend
+namespace elna::boot
{
class dependency : public error_container
{
diff --git a/include/elna/frontend/driver.h b/include/elna/boot/driver.h
index 66ef579..288aa0c 100644
--- a/include/elna/frontend/driver.h
+++ b/include/elna/boot/driver.h
@@ -18,10 +18,10 @@ along with GCC; see the file COPYING3. If not see
#pragma once
#include <optional>
-#include "elna/frontend/ast.h"
+#include "elna/boot/ast.h"
#include "location.hh"
-namespace elna::frontend
+namespace elna::boot
{
position make_position(const yy::location& location);
diff --git a/include/elna/frontend/result.h b/include/elna/boot/result.h
index 7e5ed77..9fc1849 100644
--- a/include/elna/frontend/result.h
+++ b/include/elna/boot/result.h
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include <memory>
#include <variant>
-namespace elna::frontend
+namespace elna::boot
{
/**
* Position in the source text.
@@ -118,7 +118,7 @@ namespace elna::frontend
}
template<>
-struct std::hash<elna::frontend::identifier_definition>
+struct std::hash<elna::boot::identifier_definition>
{
- std::size_t operator()(const elna::frontend::identifier_definition& key) const noexcept;
+ std::size_t operator()(const elna::boot::identifier_definition& key) const noexcept;
};
diff --git a/include/elna/frontend/semantic.h b/include/elna/boot/semantic.h
index 887b660..66eb0a7 100644
--- a/include/elna/frontend/semantic.h
+++ b/include/elna/boot/semantic.h
@@ -22,11 +22,11 @@ along with GCC; see the file COPYING3. If not see
#include <memory>
#include <deque>
-#include "elna/frontend/ast.h"
-#include "elna/frontend/result.h"
-#include "elna/frontend/symbol.h"
+#include "elna/boot/ast.h"
+#include "elna/boot/result.h"
+#include "elna/boot/symbol.h"
-namespace elna::frontend
+namespace elna::boot
{
class undeclared_error : public error
{
diff --git a/include/elna/frontend/symbol.h b/include/elna/boot/symbol.h
index ec912ef..5ef917e 100644
--- a/include/elna/frontend/symbol.h
+++ b/include/elna/boot/symbol.h
@@ -24,9 +24,9 @@ along with GCC; see the file COPYING3. If not see
#include <vector>
#include <forward_list>
-#include "elna/frontend/result.h"
+#include "elna/boot/result.h"
-namespace elna::frontend
+namespace elna::boot
{
class alias_type;
class primitive_type;
diff --git a/include/elna/gcc/elna-builtins.h b/include/elna/gcc/elna-builtins.h
index 60baab7..0cdf519 100644
--- a/include/elna/gcc/elna-builtins.h
+++ b/include/elna/gcc/elna-builtins.h
@@ -30,12 +30,12 @@ namespace elna::gcc
void init_ttree();
std::shared_ptr<symbol_table> builtin_symbol_table();
- void rewrite_symbol_table(std::shared_ptr<frontend::symbol_table> info_table, std::shared_ptr<symbol_table> symbols);
- tree handle_symbol(const std::string& symbol_name, std::shared_ptr<frontend::alias_type> reference,
+ void rewrite_symbol_table(std::shared_ptr<boot::symbol_table> info_table, std::shared_ptr<symbol_table> symbols);
+ tree handle_symbol(const std::string& symbol_name, std::shared_ptr<boot::alias_type> reference,
std::shared_ptr<symbol_table> symbols);
- tree get_inner_alias(const frontend::type& type, std::shared_ptr<symbol_table> symbols);
- void declare_procedure(const std::string& name, const frontend::procedure_info& info,
+ tree get_inner_alias(const boot::type& type, std::shared_ptr<symbol_table> symbols);
+ void declare_procedure(const std::string& name, const boot::procedure_info& info,
std::shared_ptr<symbol_table> symbols);
- tree declare_variable(const std::string& name, const frontend::variable_info& info,
+ tree declare_variable(const std::string& name, const boot::variable_info& info,
std::shared_ptr<symbol_table> symbols);
}
diff --git a/include/elna/gcc/elna-diagnostic.h b/include/elna/gcc/elna-diagnostic.h
index 83f768e..1eef65d 100644
--- a/include/elna/gcc/elna-diagnostic.h
+++ b/include/elna/gcc/elna-diagnostic.h
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include <deque>
#include <memory>
-#include "elna/frontend/result.h"
+#include "elna/boot/result.h"
namespace elna::gcc
{
@@ -40,7 +40,7 @@ namespace elna::gcc
~linemap_guard();
};
- location_t get_location(const frontend::position *position);
+ location_t get_location(const boot::position *position);
std::string print_type(tree type);
- void report_errors(const std::deque<std::unique_ptr<frontend::error>>& errors);
+ void report_errors(const std::deque<std::unique_ptr<boot::error>>& errors);
}
diff --git a/include/elna/gcc/elna-generic.h b/include/elna/gcc/elna-generic.h
index ec6f32f..7490e92 100644
--- a/include/elna/gcc/elna-generic.h
+++ b/include/elna/gcc/elna-generic.h
@@ -17,9 +17,9 @@ along with GCC; see the file COPYING3. If not see
#pragma once
-#include "elna/frontend/ast.h"
-#include "elna/frontend/symbol.h"
-#include "elna/frontend/semantic.h"
+#include "elna/boot/ast.h"
+#include "elna/boot/symbol.h"
+#include "elna/boot/semantic.h"
#include "elna/gcc/elna-tree.h"
#include "config.h"
@@ -33,65 +33,65 @@ along with GCC; see the file COPYING3. If not see
namespace elna::gcc
{
- class generic_visitor final : public frontend::empty_visitor
+ class generic_visitor final : public boot::empty_visitor
{
tree current_expression{ NULL_TREE };
- elna::frontend::symbol_bag bag;
+ elna::boot::symbol_bag bag;
std::shared_ptr<symbol_table> symbols;
void enter_scope();
tree leave_scope();
- void make_if_branch(frontend::conditional_statements& branch, tree goto_endif);
+ void make_if_branch(boot::conditional_statements& branch, tree goto_endif);
- tree build_arithmetic_operation(frontend::binary_expression *expression,
+ tree build_arithmetic_operation(boot::binary_expression *expression,
tree_code operator_code, tree left, tree right);
- tree build_comparison_operation(frontend::binary_expression *expression,
+ tree build_comparison_operation(boot::binary_expression *expression,
tree_code operator_code, tree left, tree right);
- tree build_bit_logic_operation(frontend::binary_expression *expression, tree left, tree right);
- tree build_equality_operation(frontend::binary_expression *expression, tree left, tree right);
+ tree build_bit_logic_operation(boot::binary_expression *expression, tree left, tree right);
+ tree build_equality_operation(boot::binary_expression *expression, tree left, tree right);
void build_procedure_call(location_t call_location,
- tree procedure_address, const std::vector<frontend::expression *>& arguments);
+ tree procedure_address, const std::vector<boot::expression *>& arguments);
void build_record_call(location_t call_location,
- tree symbol, const std::vector<frontend::expression *>& arguments);
- bool build_builtin_procedures(frontend::procedure_call *call);
- void build_assert_builtin(location_t call_location, const std::vector<frontend::expression *>& arguments);
+ tree symbol, const std::vector<boot::expression *>& arguments);
+ bool build_builtin_procedures(boot::procedure_call *call);
+ void build_assert_builtin(location_t call_location, const std::vector<boot::expression *>& arguments);
- bool expect_trait_type_only(frontend::traits_expression *trait);
- bool expect_trait_for_integral_type(frontend::traits_expression *trait);
- void visit_statements(const std::vector<frontend::statement *>& statements);
+ bool expect_trait_type_only(boot::traits_expression *trait);
+ bool expect_trait_for_integral_type(boot::traits_expression *trait);
+ void visit_statements(const std::vector<boot::statement *>& statements);
bool assert_constant(location_t expression_location);
public:
- generic_visitor(std::shared_ptr<symbol_table> symbol_table, elna::frontend::symbol_bag bag);
+ generic_visitor(std::shared_ptr<symbol_table> symbol_table, elna::boot::symbol_bag bag);
- void visit(frontend::program *program) override;
- void visit(frontend::procedure_declaration *definition) override;
- void visit(frontend::procedure_call *call) override;
- void visit(frontend::cast_expression *expression) override;
- void visit(frontend::traits_expression *trait) override;
- void visit(frontend::literal<std::int32_t> *literal) override;
- void visit(frontend::literal<std::uint32_t> *literal) override;
- void visit(frontend::literal<double> *literal) override;
- void visit(frontend::literal<bool> *boolean) override;
- void visit(frontend::literal<unsigned char> *character) override;
- void visit(frontend::literal<std::nullptr_t> *) override;
- void visit(frontend::literal<std::string> *string) override;
- void visit(frontend::binary_expression *expression) override;
- void visit(frontend::unary_expression *expression) override;
- void visit(frontend::constant_declaration *definition) override;
- void visit(frontend::variable_declaration *declaration) override;
- void visit(frontend::named_expression *expression) override;
- void visit(frontend::array_access_expression *expression) override;
- void visit(frontend::field_access_expression *expression) override;
- void visit(frontend::dereference_expression *expression) override;
- void visit(frontend::unit *unit) override;
- void visit(frontend::assign_statement *statement) override;
- void visit(frontend::if_statement *statement) override;
- void visit(frontend::import_declaration *) override;
- void visit(frontend::while_statement *statement) override;
- void visit(frontend::return_statement *statement) override;
- void visit(frontend::defer_statement *statement) override;
- void visit(frontend::case_statement *statement) override;
+ void visit(boot::program *program) override;
+ void visit(boot::procedure_declaration *definition) override;
+ void visit(boot::procedure_call *call) override;
+ void visit(boot::cast_expression *expression) override;
+ void visit(boot::traits_expression *trait) override;
+ void visit(boot::literal<std::int32_t> *literal) override;
+ void visit(boot::literal<std::uint32_t> *literal) override;
+ void visit(boot::literal<double> *literal) override;
+ void visit(boot::literal<bool> *boolean) override;
+ void visit(boot::literal<unsigned char> *character) override;
+ void visit(boot::literal<std::nullptr_t> *) override;
+ void visit(boot::literal<std::string> *string) override;
+ void visit(boot::binary_expression *expression) override;
+ void visit(boot::unary_expression *expression) override;
+ void visit(boot::constant_declaration *definition) override;
+ void visit(boot::variable_declaration *declaration) override;
+ void visit(boot::named_expression *expression) override;
+ void visit(boot::array_access_expression *expression) override;
+ void visit(boot::field_access_expression *expression) override;
+ void visit(boot::dereference_expression *expression) override;
+ void visit(boot::unit *unit) override;
+ void visit(boot::assign_statement *statement) override;
+ void visit(boot::if_statement *statement) override;
+ void visit(boot::import_declaration *) override;
+ void visit(boot::while_statement *statement) override;
+ void visit(boot::return_statement *statement) override;
+ void visit(boot::defer_statement *statement) override;
+ void visit(boot::case_statement *statement) override;
};
}
diff --git a/include/elna/gcc/elna-tree.h b/include/elna/gcc/elna-tree.h
index 48dfeb5..f1402a7 100644
--- a/include/elna/gcc/elna-tree.h
+++ b/include/elna/gcc/elna-tree.h
@@ -27,13 +27,13 @@ along with GCC; see the file COPYING3. If not see
#include "stringpool.h"
#include "fold-const.h"
-#include "elna/frontend/ast.h"
-#include "elna/frontend/symbol.h"
+#include "elna/boot/ast.h"
+#include "elna/boot/symbol.h"
#include "elna/gcc/elna1.h"
namespace elna::gcc
{
- using symbol_table = frontend::symbol_map<tree, tree, NULL_TREE>;
+ using symbol_table = boot::symbol_map<tree, tree, NULL_TREE>;
bool is_integral_type(tree type);
bool is_numeric_type(tree type);
@@ -74,11 +74,11 @@ namespace elna::gcc
void defer(tree statement_tree);
tree chain_defer();
- tree do_pointer_arithmetic(frontend::binary_operator binary_operator,
+ tree do_pointer_arithmetic(boot::binary_operator binary_operator,
tree left, tree right, location_t expression_location);
- tree build_binary_operation(bool condition, frontend::binary_expression *expression,
+ tree build_binary_operation(bool condition, boot::binary_expression *expression,
tree_code operator_code, tree left, tree right, tree target_type);
- tree build_arithmetic_operation(frontend::binary_expression *expression,
+ tree build_arithmetic_operation(boot::binary_expression *expression,
tree_code operator_code, tree left, tree right);
tree build_field(location_t location, tree record_type, const std::string name, tree type);
tree find_field_by_name(location_t expression_location, tree type, const std::string& field_name);