20 lines
540 B
C++
20 lines
540 B
C++
#pragma once
|
|
#include <string>
|
|
#include <token/token.hpp>
|
|
#include <unordered_map>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
namespace Compile
|
|
{
|
|
class Compiler {
|
|
private:
|
|
std::unordered_map<std::string, std::size_t> jumpLabelLocations;
|
|
std::vector<std::pair<Token::Token, std::size_t>> unresolvedJumpLabels;
|
|
|
|
void InsertAsBytes(Token::Token const & token, std::vector<std::uint8_t> & bytes);
|
|
|
|
public:
|
|
bool Compile(std::vector<Token::Token> const & tokens, std::vector<std::uint8_t> & bytes);
|
|
};
|
|
} |