Files
Fig-TreeWalker/src/Bytecode/Chunk.hpp

25 lines
580 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <Core/fig_string.hpp>
#include <Bytecode/Instruction.hpp>
#include <Evaluator/Value/value.hpp>
#include <vector>
namespace Fig
{
struct ChunkAddressInfo
{
FString sourcePath;
std::vector<FString> sourceLines;
};
struct Chunk
{
Instructions ins; // vector<Instruction>
std::vector<Object> constants; // 常量池
std::vector<InstructionAddressInfo> instructions_addr; // 下标和ins对齐表示每个Instruction对应的地址
ChunkAddressInfo addr; // 代码块独立Addr
};
};