sun::semantic_analysis::SemanticAnalyzer
class · Source (opens in a new tab)
class sun::semantic_analysis::SemanticAnalyzerOwn the semantic context, pipeline, and expression-checking helpers.
The pipeline owns the passes, which share this session's state and helpers.
Public Functions
- SemanticAnalyzer
- analyzeExpr
- bodies
- calls
- classes
- context
- declarations
- enums
- expressions
- generics
- getRootScope
- interfaces
- operator=
- pipeline
- typeResolver
SemanticAnalyzer
SemanticAnalyzer(const SemanticAnalyzer &)=delete
public · function · Source (opens in a new tab)
sun::semantic_analysis::SemanticAnalyzer::SemanticAnalyzer(const SemanticAnalyzer &)=deleteKeep pass and helper references tied to this session.
Related: SemanticAnalyzer
SemanticAnalyzer(std::shared_ptr< sun::semantic_analysis::AnalysisResults > results)
public · function · Source (opens in a new tab)
sun::semantic_analysis::SemanticAnalyzer::SemanticAnalyzer(std::shared_ptr< sun::semantic_analysis::AnalysisResults > results)Create the shared context, checking helpers, and pipeline for a program.
Related: sun::semantic_analysis::AnalysisResults
analyzeExpr
public · function · Source (opens in a new tab)
void sun::semantic_analysis::SemanticAnalyzer::analyzeExpr(sun::ast::ExprAST &expr, sun::types::TypePtr expectedType=nullptr)Check an expression after declaration passes have run.
Resolve its type and record what codegen needs. expectedType is an optional hint from the context, such as the declared type of the variable being assigned.
Related: sun::ast::ExprAST, sun::types::TypePtr
bodies
public · function · Source (opens in a new tab)
BodyAnalyzer & sun::semantic_analysis::SemanticAnalyzer::bodies()Recursive statement and function-body checking.
Related: BodyAnalyzer
calls
public · function · Source (opens in a new tab)
CallAnalyzer & sun::semantic_analysis::SemanticAnalyzer::calls()Call resolution and checking.
Related: CallAnalyzer
classes
public · function · Source (opens in a new tab)
ClassAnalyzer & sun::semantic_analysis::SemanticAnalyzer::classes()Class definitions, partial classes, and packed layout restrictions.
Related: ClassAnalyzer
context
public · function · Source (opens in a new tab)
SemanticContext & sun::semantic_analysis::SemanticAnalyzer::context()Scopes, symbol tables and the type registry of this analysis run.
Related: SemanticContext
declarations
public · function · Source (opens in a new tab)
DeclarationAnalyzer & sun::semantic_analysis::SemanticAnalyzer::declarations()Declaration checks, signatures, and global initializer dependencies.
Related: DeclarationAnalyzer
enums
public · function · Source (opens in a new tab)
EnumAnalyzer & sun::semantic_analysis::SemanticAnalyzer::enums()Enum definitions, variant construction, and match patterns.
Related: EnumAnalyzer
expressions
public · function · Source (opens in a new tab)
ExpressionAnalyzer & sun::semantic_analysis::SemanticAnalyzer::expressions()Expression checking, result types, conversions, and value access.
Related: ExpressionAnalyzer
generics
public · function · Source (opens in a new tab)
GenericSpecializer & sun::semantic_analysis::SemanticAnalyzer::generics()Monomorphization: the specializations this run has built.
Related: GenericSpecializer
getRootScope
public · function · Source (opens in a new tab)
const SemanticScope & sun::semantic_analysis::SemanticAnalyzer::getRootScope() constThe global scope, for debugging and visualization.
Related: SemanticScope
interfaces
public · function · Source (opens in a new tab)
InterfaceAnalyzer & sun::semantic_analysis::SemanticAnalyzer::interfaces()Interface contracts, default methods, and class conformance.
Related: InterfaceAnalyzer
operator=
public · function · Source (opens in a new tab)
SemanticAnalyzer & sun::semantic_analysis::SemanticAnalyzer::operator=(const SemanticAnalyzer &)=deleteDisallows assignment so ownership and object identity cannot be duplicated.
Related: SemanticAnalyzer
pipeline
public · function · Source (opens in a new tab)
sun::semantic_analysis::SemanticPipeline & sun::semantic_analysis::SemanticAnalyzer::pipeline()The persistent pipeline that owns and orders this session's passes.
Related: sun::semantic_analysis::SemanticPipeline
typeResolver
public · function · Source (opens in a new tab)
type_analysis::TypeResolver & sun::semantic_analysis::SemanticAnalyzer::typeResolver()Type-annotation resolution and scoped substitutions.
Related: type_analysis::TypeResolver
Private Fields
- bodies_
- calls_
- classes_
- ctx_
- declarations_
- enums_
- expressions_
- generics_
- interfaces_
- pipeline_
- resolver_
bodies_
private · variable · Source (opens in a new tab)
BodyAnalyzer sun::semantic_analysis::SemanticAnalyzer::bodies_ {ctx_, *this}No documentation comment.
Related: BodyAnalyzer, ctx_
calls_
private · variable · Source (opens in a new tab)
CallAnalyzer sun::semantic_analysis::SemanticAnalyzer::calls_ {ctx_, *this, generics_, resolver_}No documentation comment.
Related: CallAnalyzer, ctx_, generics_, resolver_
classes_
private · variable · Source (opens in a new tab)
ClassAnalyzer sun::semantic_analysis::SemanticAnalyzer::classes_ {ctx_, *this}No documentation comment.
Related: ClassAnalyzer, ctx_
ctx_
private · variable · Source (opens in a new tab)
SemanticContext sun::semantic_analysis::SemanticAnalyzer::ctx_No documentation comment.
Related: SemanticContext
declarations_
private · variable · Source (opens in a new tab)
DeclarationAnalyzer sun::semantic_analysis::SemanticAnalyzer::declarations_ {ctx_, *this}No documentation comment.
Related: DeclarationAnalyzer, ctx_
enums_
private · variable · Source (opens in a new tab)
EnumAnalyzer sun::semantic_analysis::SemanticAnalyzer::enums_ {ctx_, *this, generics_, resolver_}No documentation comment.
Related: EnumAnalyzer, ctx_, generics_, resolver_
expressions_
private · variable · Source (opens in a new tab)
ExpressionAnalyzer sun::semantic_analysis::SemanticAnalyzer::expressions_ {ctx_, *this}No documentation comment.
Related: ExpressionAnalyzer, ctx_
generics_
private · variable · Source (opens in a new tab)
GenericSpecializer sun::semantic_analysis::SemanticAnalyzer::generics_ {ctx_, *this}No documentation comment.
Related: GenericSpecializer, ctx_
interfaces_
private · variable · Source (opens in a new tab)
InterfaceAnalyzer sun::semantic_analysis::SemanticAnalyzer::interfaces_ {ctx_, *this, generics_, resolver_}No documentation comment.
Related: InterfaceAnalyzer, ctx_, generics_, resolver_
pipeline_
private · variable · Source (opens in a new tab)
sun::semantic_analysis::SemanticPipeline sun::semantic_analysis::SemanticAnalyzer::pipeline_ {*this}No documentation comment.
Related: sun::semantic_analysis::SemanticPipeline
resolver_
private · variable · Source (opens in a new tab)
type_analysis::TypeResolver sun::semantic_analysis::SemanticAnalyzer::resolver_ {ctx_, generics_, *this}No documentation comment.
Related: type_analysis::TypeResolver, ctx_, generics_