Halting work on preprocesser units and rewrite as a whole

I've decided to split the project into 2 repositories: the assembler
and the runtime.  The runtime will contain both the executable and
lib/ while the assembler will have the runtime as a git submodule and
use it to build.  I think this is a clean solution, a lot cleaner than
having them all in one project where the Makefile has to massively
expand.
This commit is contained in:
2024-04-16 15:42:59 +06:30
parent d5c43b1c3f
commit 8f75241bcb
2 changed files with 23 additions and 0 deletions

View File

@@ -208,3 +208,11 @@ pp_err_t::pp_err_t(pp_err_type_t err, const token_t *ref)
pp_err_t::pp_err_t(pp_err_type_t err, const token_t *ref, lerr_t lerr)
: reference{ref}, type{err}, lerr{lerr}
{}
// pp_unit_t::pp_unit_t(const token_t *const token) : resolved{false},
// token{token}
// {}
// pp_unit_t::pp_unit_t(std::string_view name, std::vector<pp_unit_t> elements)
// : resolved{false}, token{nullptr}, container{name, elements}
// {}

View File

@@ -42,6 +42,21 @@ struct pp_err_t
std::ostream &operator<<(std::ostream &, pp_err_t &);
struct pp_unit_t
{
const token_t *const token;
struct
{
std::string_view name;
std::vector<pp_unit_t> elements;
} container;
pp_unit_t(const token_t *const);
pp_unit_t(std::string_view, std::vector<pp_unit_t>);
};
std::vector<pp_unit_t> tokens_to_units(const std::vector<token_t *> &);
pp_err_t preprocess_use(std::vector<pp_unit_t> &);
pp_err_t preprocesser(const std::vector<token_t *> &, std::vector<token_t *> &);
#endif