回档之后的重写。部分问题修复。添加了什么我也忘了
This commit is contained in:
25
src/Bytecode/Chunk.hpp
Normal file
25
src/Bytecode/Chunk.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#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
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user