|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Abstract language frontend that can feed reusable drivers. More...
#include <Compiler_Frontend.H>
Public Member Functions | |
| virtual | ~Compiler_Frontend ()=default |
| virtual const char * | name () const noexcept=0 |
| Returns a stable user-facing frontend name. | |
| 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 bool | parse ()=0 |
| Parses all previously loaded sources. | |
| virtual bool | analyze ()=0 |
| Runs semantic analysis on the parsed program. | |
| virtual bool | lower_hir ()=0 |
| Lowers the analyzed program into common HIR. | |
| virtual bool | lower_ir ()=0 |
| Lowers the analyzed program into common IR. | |
| virtual Diagnostic_Engine * | diagnostic_engine () noexcept=0 |
| Returns the diagnostic engine populated by the frontend. | |
| virtual const Diagnostic_Engine * | diagnostic_engine () const noexcept=0 |
| Returns the diagnostic engine populated by the frontend. | |
| virtual const Compiler_Type_Context * | type_context () const noexcept=0 |
| Returns the optional shared type context for dumps and backends. | |
| virtual const Compiler_HIR_Module * | hir_module () const noexcept=0 |
| Returns the lowered HIR module from the last run, when available. | |
| virtual const Compiler_IR_Module * | ir_module () const noexcept=0 |
| Returns the lowered IR module from the last run, when available. | |
| virtual const DynArray< Compiler_Module_Descriptor > & | module_descriptors () const noexcept |
| Returns parsed module descriptors for reusable import orchestration. | |
| virtual const DynArray< size_t > & | module_merge_order () const noexcept |
| Returns the dependency-first merge order from the last parse. | |
| virtual const DynArray< Compiler_Module_Metadata > & | module_metadata () const noexcept |
| Returns reusable metadata for the top-level surface of each module. | |
| virtual const DynArray< Compiler_Driver_Artifact > & | artifacts () const noexcept=0 |
| Returns all frontend-produced artifacts from the last run. | |
| virtual const Compiler_Driver_Artifact * | find_artifact (std::string_view label) const noexcept=0 |
| Finds one frontend artifact by exact label. | |
| virtual const DynArray< std::string > & | errors () const noexcept=0 |
| Returns hard frontend-level errors outside the diagnostic engine. | |
| virtual const DynArray< std::string > & | warnings () const noexcept=0 |
| Returns non-fatal frontend-level warnings. | |
Abstract language frontend that can feed reusable drivers.
Definition at line 57 of file Compiler_Frontend.H.
|
virtualdefault |
Runs semantic analysis on the parsed program.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Referenced by Aleph::Compiler_Generic_Driver::execute_sources().
|
pure virtualnoexcept |
Returns all frontend-produced artifacts from the last run.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Referenced by Aleph::Compiler_Generic_Driver::collect_frontend_state().
Clears all frontend-owned state from the previous run.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Referenced by Aleph::Compiler_Generic_Driver::clear().
|
pure virtualnoexcept |
Returns the diagnostic engine populated by the frontend.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
|
pure virtualnoexcept |
Returns the diagnostic engine populated by the frontend.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Referenced by Aleph::Compiler_Generic_Driver::clear(), Aleph::Compiler_Generic_Driver::diagnostics_text(), Aleph::Compiler_Generic_Driver::ok(), and Aleph::Compiler_Generic_Driver::record_diagnostics_artifact().
|
pure virtualnoexcept |
Returns hard frontend-level errors outside the diagnostic engine.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Referenced by Aleph::Compiler_Generic_Driver::collect_frontend_state().
|
pure virtualnoexcept |
Finds one frontend artifact by exact label.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Referenced by Aleph::Compiler_Generic_Driver::record_import_order_artifact(), Aleph::Compiler_Generic_Driver::record_module_bindings_artifact(), Aleph::Compiler_Generic_Driver::record_module_linkage_artifact(), Aleph::Compiler_Generic_Driver::record_module_metadata_artifact(), Aleph::Compiler_Generic_Driver::record_module_name_table_artifact(), and Aleph::Compiler_Generic_Driver::record_module_semantic_environment_artifact().
|
pure virtualnoexcept |
Returns the lowered HIR module from the last run, when available.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Referenced by Aleph::Compiler_Generic_Driver::execute_hir_runtime().
|
pure virtualnoexcept |
Returns the lowered IR module from the last run, when available.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Referenced by Aleph::Compiler_Generic_Driver::emit_c(), and Aleph::Compiler_Generic_Driver::lower_bytecode().
|
pure virtual |
Registers the ordered input sources for the next run.
| inputs | Input sources to register in frontend-specific storage. |
true if the inputs are acceptable. Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Referenced by Aleph::Compiler_Generic_Driver::execute_sources().
Lowers the analyzed program into common HIR.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Referenced by Aleph::Compiler_Generic_Driver::execute_sources().
Lowers the analyzed program into common IR.
Implementations may lower from HIR or directly from language-specific semantic state, as long as the resulting Compiler_IR_Module follows the public IR contracts.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Referenced by Aleph::Compiler_Generic_Driver::execute_sources().
|
inlinevirtualnoexcept |
Returns parsed module descriptors for reusable import orchestration.
Frontends that do not model imports may return an empty array.
Reimplemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Definition at line 127 of file Compiler_Frontend.H.
Referenced by Aleph::Compiler_Generic_Driver::record_import_order_artifact(), Aleph::Compiler_Generic_Driver::record_module_bindings_artifact(), Aleph::Compiler_Generic_Driver::record_module_linkage_artifact(), Aleph::Compiler_Generic_Driver::record_module_name_table_artifact(), and Aleph::Compiler_Generic_Driver::record_module_semantic_environment_artifact().
|
inlinevirtualnoexcept |
Returns the dependency-first merge order from the last parse.
Frontends that do not reorder modules may return an empty array.
Reimplemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Definition at line 138 of file Compiler_Frontend.H.
Referenced by Aleph::Compiler_Generic_Driver::record_import_order_artifact(), Aleph::Compiler_Generic_Driver::record_module_bindings_artifact(), Aleph::Compiler_Generic_Driver::record_module_linkage_artifact(), Aleph::Compiler_Generic_Driver::record_module_name_table_artifact(), and Aleph::Compiler_Generic_Driver::record_module_semantic_environment_artifact().
|
inlinevirtualnoexcept |
Returns reusable metadata for the top-level surface of each module.
Until the platform grows explicit export syntax, frontends typically map this to all top-level declarations that the module contributes.
Reimplemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Definition at line 150 of file Compiler_Frontend.H.
Referenced by Aleph::Compiler_Generic_Driver::record_module_bindings_artifact(), Aleph::Compiler_Generic_Driver::record_module_linkage_artifact(), Aleph::Compiler_Generic_Driver::record_module_metadata_artifact(), Aleph::Compiler_Generic_Driver::record_module_name_table_artifact(), and Aleph::Compiler_Generic_Driver::record_module_semantic_environment_artifact().
Returns a stable user-facing frontend name.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Parses all previously loaded sources.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Referenced by Aleph::Compiler_Generic_Driver::execute_sources().
|
pure virtualnoexcept |
Returns the optional shared type context for dumps and backends.
Frontends that do not use Compiler_Types.H may return nullptr.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Referenced by Aleph::Compiler_Generic_Driver::lower_bytecode().
|
pure virtualnoexcept |
Returns non-fatal frontend-level warnings.
Implemented in Aleph::Compiler_Line_Frontend, and Aleph::Compiler_MVP_Frontend.
Referenced by Aleph::Compiler_Generic_Driver::collect_frontend_state().