Gyoji Compiler
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Gyoji::frontend::lowering::FunctionDefinitionResolver Class Reference

Lowering for a function. More...

#include <function-resolver.hpp>

Public Member Functions

bool resolve ()
 Resolve a single function definition.
 

Detailed Description

Lowering for a function.

This class is responsible for converting a FileStatementFunctionDefinition into an equivalent program in the MIR representation. This iterates the statements inside the function definition and emits MIR code that matches the intend. In addition, rules for the validity of the program are evaluated so that grossly invalid programs never make it to the MIR level. Semantic errors are reported through the CompilerContext in the form of context-aware messages that highlight where the error took place.

Member Function Documentation

◆ resolve()

bool FunctionDefinitionResolver::resolve ( )

Resolve a single function definition.

Performs the bulk of the logic for reading a function definition and emitting equivalent MIR for it. The MIR will be in a form that can be used in the code-generation phase.

This method returns false if the MIR is unsuitable for code-generation due to semantic errors that were found. Note that not all errors will result in an invalid MIR, however, some constructs will make the resulting MIR unsuitible for code generation.


The documentation for this class was generated from the following files: