forked from PuqiAR/Fig-TreeWalker
[VER] 0.3.7-alpha
[Fix] 修复科学表达式数字解析的问题(Lexer引起) 由 Satklomi发现,感谢 [Feat] 增加Compiler相关定义,将开发BytecodeVM [Tip] Evaluator进入Bug fix阶段,新功能延缓开发。转向VM
This commit is contained in:
32
src/Compiler/Compiler.hpp
Normal file
32
src/Compiler/Compiler.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include "Ast/astBase.hpp"
|
||||
#include <Ast/ast.hpp>
|
||||
#include <Bytecode/Bytecode.hpp>
|
||||
#include <VMValue/VMValue.hpp>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Fig
|
||||
{
|
||||
class Compiler
|
||||
{
|
||||
private:
|
||||
std::vector<Ast::Statement> source;
|
||||
std::vector<OpCodeType> output; // std::vector<uint8_t>
|
||||
|
||||
std::vector<Value> constants;
|
||||
public:
|
||||
std::vector<OpCodeType> getOutput() const { return output; }
|
||||
std::vector<Value> getConstantPool() const { return constants; }
|
||||
|
||||
Compiler() {}
|
||||
Compiler(std::vector<Ast::Statement> _source) : source(std::move(_source)) {}
|
||||
|
||||
void compile_expr(Ast::Expression);
|
||||
|
||||
void compile(Ast::Statement);
|
||||
|
||||
void CompileAll();
|
||||
};
|
||||
}; // namespace Fig
|
||||
Reference in New Issue
Block a user