This commit is contained in:
Andre Wagner
2026-04-30 17:41:56 -05:00
parent 225458e6c0
commit efe89a37b8
5 changed files with 40 additions and 7 deletions

View File

@@ -1,12 +1,32 @@
#include "assembler.hh"
#include "as_exceptions.hh"
#include "../bytecode/bytecode.hh"
namespace tyche::as {
ByteArray Assembler::assemble()
{
lexer_.reset();
bp_ = {};
return {};
enum class Section { Const, Function } section;
uint32_t function_id = 0;
for (;;) {
Token t = lexer_.ingest();
if (t.type == TokenType::Directive) {
} else if (section == Section::Const && t.type == TokenType::Integer) {
} else if (section == Section::Function && t.type == TokenType::Instruction) {
} else if (t.type == TokenType::EOF_) {
break;
} else if (t.type != TokenType::Enter) {
throw AssemblyError("Unexpected token " + t.token, t.line, t.column);
}
}
return bc::Bytecode::generate(bp_);
}
} // tyche