pub struct CoreAnalyzer<'a> {
context: &'a mut CompilationContext,
}
Expand description
Core analyzer that coordinates between statement and expression visitors
This analyzer provides a unified interface for semantic analysis by delegating to specialized visitors. It maintains efficient visitor reuse to avoid unnecessary allocations and improve performance.
Fields§
§context: &'a mut CompilationContext
Implementations§
Source§impl<'a> CoreAnalyzer<'a>
impl<'a> CoreAnalyzer<'a>
Sourcepub fn new(context: &'a mut CompilationContext) -> Self
pub fn new(context: &'a mut CompilationContext) -> Self
Create a new core analyzer
§Arguments
context
- The compilation context for symbol management and types
Sourcepub fn context(&mut self) -> &mut CompilationContext
pub fn context(&mut self) -> &mut CompilationContext
Provides access to the compilation context.
Sourcepub fn analyze_statement(&mut self, stmt: &Statement) -> SemanticResult
pub fn analyze_statement(&mut self, stmt: &Statement) -> SemanticResult
Analyze a statement using the appropriate visitor
This method reuses a single visitor instance for all statement operations to improve performance and reduce allocations.
Sourcepub fn analyze_expression(&mut self, expr: &Expression) -> SemanticResult
pub fn analyze_expression(&mut self, expr: &Expression) -> SemanticResult
Analyze an expression using the expression visitor
This method reuses a single visitor instance for all expression operations to improve performance and reduce allocations.
Sourcepub fn analyze_block(&mut self, block: &BlockExpr) -> SemanticResult
pub fn analyze_block(&mut self, block: &BlockExpr) -> SemanticResult
Analyze a block expression
This method reuses a single visitor instance for all block operations to improve performance and reduce allocations.