Struct CoreAnalyzer

Source
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>

Source

pub fn new(context: &'a mut CompilationContext) -> Self

Create a new core analyzer

§Arguments
  • context - The compilation context for symbol management and types
Source

pub fn context(&mut self) -> &mut CompilationContext

Provides access to the compilation context.

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

§

impl<'a> Freeze for CoreAnalyzer<'a>

§

impl<'a> RefUnwindSafe for CoreAnalyzer<'a>

§

impl<'a> Send for CoreAnalyzer<'a>

§

impl<'a> Sync for CoreAnalyzer<'a>

§

impl<'a> Unpin for CoreAnalyzer<'a>

§

impl<'a> !UnwindSafe for CoreAnalyzer<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.