|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Lowers the MVP typed AST into HIR. More...
#include <Compiler_HIR_Lowering_MVP.H>
Public Member Functions | |
| Compiler_HIR_Lowering (Compiler_HIR_Context &context, const Compiler_Typed_Semantic_Analyzer &analysis) noexcept | |
| Constructs a lowering helper. | |
| Compiler_HIR_Function * | lower_function (const Compiler_Function_Decl *function) |
| Lowers one function declaration into HIR. | |
| Compiler_HIR_Module * | lower_module (const Compiler_Module *module) |
| Lowers one module into HIR. | |
Private Member Functions | |
| Compiler_Type_Id | invalid_type () const noexcept |
| Compiler_Type_Id | expr_type (const Compiler_Expr *expr) const noexcept |
| Compiler_Type_Id | function_type (const Compiler_Function_Decl *function) const noexcept |
| Compiler_HIR_Expr * | lower_expr (const Compiler_Expr *expr) |
| Compiler_HIR_Stmt * | lower_stmt (const Compiler_Stmt *stmt) |
Private Attributes | |
| Compiler_HIR_Context * | hir = nullptr |
| const Compiler_Typed_Semantic_Analyzer * | typed = nullptr |
Lowers the MVP typed AST into HIR.
Definition at line 49 of file Compiler_HIR_Lowering_MVP.H.
|
inlinenoexcept |
Constructs a lowering helper.
| context | HIR allocation context. |
| analysis | Typed semantic analysis results. |
Definition at line 252 of file Compiler_HIR_Lowering_MVP.H.
|
inlineprivatenoexcept |
Definition at line 59 of file Compiler_HIR_Lowering_MVP.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::Compiler_Typed_Semantic_Analyzer::inferred_type(), invalid_type(), and typed.
Referenced by lower_expr().
|
inlineprivatenoexcept |
Definition at line 68 of file Compiler_HIR_Lowering_MVP.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::Compiler_Typed_Semantic_Analyzer::function_type(), invalid_type(), and typed.
Referenced by lower_function().
|
inlineprivatenoexcept |
Definition at line 54 of file Compiler_HIR_Lowering_MVP.H.
References Aleph::Compiler_Type_Context::invalid_type(), Aleph::Compiler_Typed_Semantic_Analyzer::type_context(), and typed.
Referenced by expr_type(), function_type(), lower_expr(), lower_function(), and lower_stmt().
|
inlineprivate |
Definition at line 77 of file Compiler_HIR_Lowering_MVP.H.
References Aleph::Compiler_HIR_Call_Expr::arguments, Aleph::Binary, Aleph::Bool, Aleph::Bool_Literal, Aleph::Call, Aleph::Char_Literal, Aleph::Character, Aleph::compiler_operator_from_token_kind(), expr_type(), Aleph::Grouping, hir, Aleph::Identifier, Aleph::Integer, Aleph::Integer_Literal, Aleph::Invalid, invalid_type(), Aleph::Compiler_Expr::kind, lower_expr(), Aleph::Compiler_HIR_Context::make(), Aleph::Compiler_Ast_Node::span, Aleph::String, Aleph::String_Literal, and Aleph::Unary.
Referenced by lower_expr(), and lower_stmt().
|
inline |
Lowers one function declaration into HIR.
Definition at line 258 of file Compiler_HIR_Lowering_MVP.H.
References Aleph::and, Aleph::Block, Aleph::blossom_maximum_cardinality_matching(), Aleph::Compiler_Function_Decl::body, function_type(), hir, invalid_type(), lower_stmt(), Aleph::Compiler_HIR_Context::make(), Aleph::Compiler_Function_Decl::name, Aleph::Compiler_Function_Decl::name_span, Aleph::Compiler_Typed_Semantic_Analyzer::parameter_type(), Aleph::Compiler_Function_Decl::parameters, Aleph::Compiler_Ast_Node::span, Aleph::Compiler_HIR_Node::span, and typed.
Referenced by lower_module().
|
inline |
Lowers one module into HIR.
Definition at line 287 of file Compiler_HIR_Lowering_MVP.H.
References Aleph::Compiler_Module::functions, hir, lower_function(), lower_stmt(), Aleph::Compiler_HIR_Context::make(), and Aleph::Compiler_Module::statements.
|
inlineprivate |
Definition at line 168 of file Compiler_HIR_Lowering_MVP.H.
References Aleph::Block, Aleph::blossom_maximum_cardinality_matching(), Aleph::Break, Aleph::Continue, Aleph::Expr, hir, Aleph::If, Aleph::Invalid, invalid_type(), Aleph::Compiler_Stmt::kind, Aleph::Let, Aleph::Compiler_Typed_Semantic_Analyzer::let_type(), lower_expr(), lower_stmt(), Aleph::Compiler_HIR_Context::make(), Aleph::Return, Aleph::Compiler_Ast_Node::span, Aleph::Compiler_SSA_Block::span, typed, and Aleph::While.
Referenced by lower_function(), lower_module(), and lower_stmt().
|
private |
Definition at line 51 of file Compiler_HIR_Lowering_MVP.H.
Referenced by lower_expr(), lower_function(), lower_module(), and lower_stmt().
|
private |
Definition at line 52 of file Compiler_HIR_Lowering_MVP.H.
Referenced by expr_type(), function_type(), invalid_type(), lower_function(), and lower_stmt().