43#ifndef COMPILER_FRONTEND_H
44#define COMPILER_FRONTEND_H
Shared contracts used by reusable compiler frontends and drivers.
Reusable explicit-value IR model, validation, and deterministic dumps.
Reusable source-name module dependency resolution helpers.
Plain-text diagnostic engine for compiler-style tooling.
Abstract language frontend that can feed reusable drivers.
virtual bool analyze()=0
Runs semantic analysis on the parsed program.
virtual const Compiler_Type_Context * type_context() const noexcept=0
Returns the optional shared type context for dumps and backends.
virtual bool lower_hir()=0
Lowers the analyzed program into common HIR.
virtual const DynArray< std::string > & errors() const noexcept=0
Returns hard frontend-level errors outside the diagnostic engine.
virtual const Compiler_Driver_Artifact * find_artifact(std::string_view label) const noexcept=0
Finds one frontend artifact by exact label.
virtual const DynArray< Compiler_Driver_Artifact > & artifacts() const noexcept=0
Returns all frontend-produced artifacts from the last run.
virtual const DynArray< Compiler_Module_Descriptor > & module_descriptors() const noexcept
Returns parsed module descriptors for reusable import orchestration.
virtual void clear() noexcept=0
Clears all frontend-owned state from the previous run.
virtual bool load_sources(const DynArray< Compiler_Driver_Source > &inputs)=0
Registers the ordered input sources for the next run.
virtual const DynArray< size_t > & module_merge_order() const noexcept
Returns the dependency-first merge order from the last parse.
virtual const char * name() const noexcept=0
Returns a stable user-facing frontend name.
virtual ~Compiler_Frontend()=default
virtual const Compiler_IR_Module * ir_module() const noexcept=0
Returns the lowered IR module from the last run, when available.
virtual const Compiler_HIR_Module * hir_module() const noexcept=0
Returns the lowered HIR module from the last run, when available.
virtual const DynArray< Compiler_Module_Metadata > & module_metadata() const noexcept
Returns reusable metadata for the top-level surface of each module.
virtual bool lower_ir()=0
Lowers the analyzed program into common IR.
virtual const DynArray< std::string > & warnings() const noexcept=0
Returns non-fatal frontend-level warnings.
virtual Diagnostic_Engine * diagnostic_engine() noexcept=0
Returns the diagnostic engine populated by the frontend.
virtual bool parse()=0
Parses all previously loaded sources.
Context owning all compiler type nodes.
Diagnostic accumulator and renderer.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
Stable text artifact produced during one pipeline run.
One logical input source handled by a compiler frontend.
Lowered IR module with shared global slots and functions.
One module descriptor consumed by the reusable resolver.