53 " return add(x, x);\n"
55 "let answer = twice(21);\n");
60 const auto *
module = parser.parse_module();
71 if (not evaluated.ok())
81 const auto called = runtime.
call(
"twice", arguments);
Lowering from the current MVP typed AST into the reusable HIR model.
Recursive-descent parser for the compiler-support MVP grammar.
Reusable runtime and structured evaluator for HIR-based interpreters.
Arena-backed ownership context for AST nodes.
Arena-backed ownership context for HIR nodes.
Lowers the MVP typed AST into HIR.
Compiler_HIR_Module * lower_module(const Compiler_Module *module)
Lowers one module into HIR.
Recursive-descent parser that produces an AST in Compiler_Ast_Context.
Inference-oriented semantic pass for the MVP compiler front-end.
void analyze_module(const Compiler_Module *module)
Runs the typed semantic analysis for module.
Diagnostic accumulator and renderer.
void render_plain(std::ostream &out) const
Renders all diagnostics as deterministic plain text.
T & append()
Allocate a new entry to the end of array.
Structured runtime for executing typed HIR.
Interpreter_Execution_Result call(const std::string &name, const DynArray< Interpreter_Value > &arguments)
Calls one visible function by name.
Interpreter_Execution_Result evaluate_module(const Compiler_HIR_Module *module)
Evaluates one HIR module and leaves its globals installed.
Stores source files and resolves offsets into human-readable data.
Source_File_Id add_virtual_file(const std::string &name, const std::string &text)
Registers an in-memory source file.
Main namespace for Aleph-w library functions.
std::string interpreter_dump_globals(const Interpreter_Runtime &runtime)
Dumps the globals currently installed in one runtime.
std::string interpreter_value_to_string(const Interpreter_Value &value)
Formats one runtime value deterministically for dumps and tests.
static Interpreter_Value make_integer(const long long i)
Builds an integer runtime value.