12#ifndef ARK_COMPILER_WELDER_HPP
13#define ARK_COMPILER_WELDER_HPP
46 Welder(
unsigned debug,
const std::vector<std::filesystem::path>& lib_env, uint16_t features =
DefaultFeatures);
53 void registerSymbol(
const std::string& name);
60 bool computeASTFromFile(
const std::string& filename);
67 bool computeASTFromString(
const std::string& code);
73 bool generateBytecode();
80 bool saveBytecodeToFile(
const std::string& filename);
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.
ArkScript compiler is in charge of transforming the AST into bytecode.
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.
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::Compiler m_compiler
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 bytecode 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