blob: b4b31f88a587aed47fcba26d3de0261e507e72f4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#pragma once
#include "chunk.h"
#include <exception>
#include <memory>
#include <string>
#include <vector>
class Segment: public std::vector<std::shared_ptr<Chunk>>
{
public:
void append(const std::vector<std::shared_ptr<Chunk>>& list);
size_t getAddressOfLabel(const std::string& label);
size_t getAddressOfIndex(size_t index);
std::vector<uint8_t> getCode();
void insertAddresses();
void optimize();
};
|