53 "let value = add(1, 2);\n");
58 const auto *
module = parser.parse_module();
59 if (module ==
nullptr)
61 std::cerr <<
"Parse failed: no module produced\n";
72 std::cout <<
"\nDiagnostics:\n";
Recursive-descent parser for the compiler-support MVP grammar.
Name-resolution and basic semantic checks for the compiler-support MVP.
Arena-backed ownership context for AST nodes.
Recursive-descent parser that produces an AST in Compiler_Ast_Context.
Name-resolution and basic semantic checker for the MVP AST.
std::string dump_symbols() const
Dumps the current symbol table in a deterministic text format.
void analyze_module(const Compiler_Module *module)
Analyzes a parsed module.
Diagnostic accumulator and renderer.
void render_plain(std::ostream &out) const
Renders all diagnostics as deterministic plain text.
bool has_errors() const noexcept
Returns whether any error or fatal diagnostic was emitted.
size_t size() const noexcept
Returns the number of stored diagnostics.
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 compiler_dump_module(const Compiler_Module *module)
Dumps a parsed module in a deterministic text format.