[][src]Struct open_vaf::ast_lowering::name_resolution::Resolver

pub struct Resolver<'lt> {
    pub scope_stack: Vec<&'lt SymbolTable>,
    // some fields omitted
}

Allows name resolution with the resolve/resolve_hierarchical methods

Fields

scope_stack: Vec<&'lt SymbolTable>

Implementations

impl<'lt> Resolver<'lt>[src]

pub fn new(ast: &'lt Ast) -> Self[src]

pub fn enter_function(&mut self, function_symbol_table: &'lt SymbolTable)[src]

pub fn exit_function(&mut self) -> Option<&'lt SymbolTable>[src]

pub fn resolve(&self, ident: &Ident) -> Result<SymbolDeclaration>[src]

Tries to resolve the Identifier ident

This functions first tries to find `ident in the current scope, then in the previous scope and so on If it can't find ident in the global (first) Scope it returns an NotFound Error

pub fn resolve_hierarchical(
    &self,
    hierarchical_ident: &HierarchicalId
) -> Result<SymbolDeclaration>
[src]

Tries to resolve the Hierarchical Identifer hierarchical_ident

This functions tires to resolve the first identifier using the resolve function Afterwards it tries to resolve all following identifier inside the scope of the previously resolved Identifier

pub fn enter_scope(&mut self, scope_symbol_table: &'lt SymbolTable)[src]

Enter a new Scope

This scope will be the first to be searched for identifiers until it is overshadowed by another enter_scope call or it is removed using exit_scope

Arguments

  • scope_symbol_table - Symbol table in which the resolver will look for definitions in this scope

pub fn exit_scope(&mut self) -> Option<&'lt SymbolTable>[src]

Leave the current Scope

Items defined in the current scope will not be resolved anymore by this resolver after this method has been called

Returns

  • None if the Resolver doesn't hold any Scopes
  • The Symbol_Table of the removed Scope

Auto Trait Implementations

impl<'lt> RefUnwindSafe for Resolver<'lt>

impl<'lt> Send for Resolver<'lt>

impl<'lt> Sync for Resolver<'lt>

impl<'lt> Unpin for Resolver<'lt>

impl<'lt> UnwindSafe for Resolver<'lt>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.