11#ifndef ARK_COMPILER_WELDER_HPP
12#define ARK_COMPILER_WELDER_HPP
45 Welder(
unsigned debug,
const std::vector<std::filesystem::path>& lib_env, uint16_t features =
DefaultFeatures);
52 void registerSymbol(
const std::string& name);
59 bool computeASTFromFile(
const std::string& filename);
66 bool computeASTFromString(
const std::string& code);
72 bool generateBytecode();
79 bool saveBytecodeToFile(
const std::string& filename);
82 [[nodiscard]] std::string textualIR()
const noexcept;
83 [[nodiscard]]
const bytecode_t& bytecode()
const noexcept;
91 std::vector<internal::IR::Block>
m_ir;
106 void dumpIRToFile()
const;
108 bool computeAST(
const std::string& filename,
const std::string& code);
Common code for the compiler.
Constants used by ArkScript.
Compile the intermediate representation to bytecode.
Optimize IR based on IR entity grouped by 2 (or more)
Handle imports, resolve them with modules and everything.
Resolves names and fully qualify them in the AST (prefixing them with the package they are from)
AST node used by the parser, optimizer and compiler.
Optimizes a given ArkScript AST.
Parse ArkScript code, but do not handle any import declarations.
Handles the macros and their expansion in ArkScript source code.
The welder joins all the compiler passes.
internal::ImportSolver m_import_solver
internal::Node m_computed_ast
internal::IROptimizer m_ir_optimizer
std::vector< std::string > m_imports
internal::Logger m_logger
std::vector< internal::IR::Block > m_ir
internal::NameResolutionPass m_name_resolver
std::filesystem::path m_root_file
internal::ASTLowerer m_lowerer
internal::Parser m_parser
internal::IRCompiler m_ir_compiler
internal::MacroProcessor m_macro_processor
internal::Optimizer m_ast_optimizer
std::vector< std::filesystem::path > m_lib_env
The ArkScript AST to IR compiler.
The class handling the macros definitions and calls, given an AST.
A node of an Abstract Syntax Tree for ArkScript.
The ArkScript AST optimizer.
constexpr uint16_t DefaultFeatures
std::vector< uint8_t > bytecode_t