pub struct SymbolTableCreator<'a> {
pub(crate) symbol_table: SymbolTable,
handler: &'a Handler,
program_name: Option<Symbol>,
is_stub: bool,
structs: IndexSet<Symbol>,
}
Expand description
A compiler pass during which the SymbolTable
is created.
Note that this pass only creates the initial entries for functions, structs, and records.
The table is populated further during the type checking pass.
Fields§
§symbol_table: SymbolTable
The SymbolTable
constructed by this compiler pass.
handler: &'a Handler
The error handler.
program_name: Option<Symbol>
The current program name.
is_stub: bool
Whether or not traversing stub.
structs: IndexSet<Symbol>
The set of local structs that have been successfully visited.
Implementations§
source§impl<'a> SymbolTableCreator<'a>
impl<'a> SymbolTableCreator<'a>
Trait Implementations§
source§impl<'a> ExpressionVisitor<'a> for SymbolTableCreator<'a>
impl<'a> ExpressionVisitor<'a> for SymbolTableCreator<'a>
type AdditionalInput = ()
type Output = ()
fn visit_expression( &mut self, input: &'a Expression, additional: &Self::AdditionalInput, ) -> Self::Output
fn visit_access( &mut self, input: &'a AccessExpression, additional: &Self::AdditionalInput, ) -> Self::Output
fn visit_array( &mut self, input: &'a ArrayExpression, additional: &Self::AdditionalInput, ) -> Self::Output
fn visit_binary( &mut self, input: &'a BinaryExpression, additional: &Self::AdditionalInput, ) -> Self::Output
fn visit_call( &mut self, input: &'a CallExpression, additional: &Self::AdditionalInput, ) -> Self::Output
fn visit_cast( &mut self, input: &'a CastExpression, additional: &Self::AdditionalInput, ) -> Self::Output
fn visit_struct_init( &mut self, _input: &'a StructExpression, _additional: &Self::AdditionalInput, ) -> Self::Output
fn visit_err( &mut self, _input: &'a ErrExpression, _additional: &Self::AdditionalInput, ) -> Self::Output
fn visit_identifier( &mut self, _input: &'a Identifier, _additional: &Self::AdditionalInput, ) -> Self::Output
fn visit_literal( &mut self, _input: &'a Literal, _additional: &Self::AdditionalInput, ) -> Self::Output
fn visit_locator( &mut self, _input: &'a LocatorExpression, _additional: &Self::AdditionalInput, ) -> Self::Output
fn visit_ternary( &mut self, input: &'a TernaryExpression, additional: &Self::AdditionalInput, ) -> Self::Output
fn visit_tuple( &mut self, input: &'a TupleExpression, additional: &Self::AdditionalInput, ) -> Self::Output
fn visit_unary( &mut self, input: &'a UnaryExpression, additional: &Self::AdditionalInput, ) -> Self::Output
fn visit_unit( &mut self, _input: &'a UnitExpression, _additional: &Self::AdditionalInput, ) -> Self::Output
source§impl<'a> Pass for SymbolTableCreator<'a>
impl<'a> Pass for SymbolTableCreator<'a>
source§impl<'a> ProgramVisitor<'a> for SymbolTableCreator<'a>
impl<'a> ProgramVisitor<'a> for SymbolTableCreator<'a>
fn visit_program_scope(&mut self, input: &'a ProgramScope)
fn visit_import(&mut self, input: &'a Program)
fn visit_struct(&mut self, input: &'a Composite)
fn visit_mapping(&mut self, input: &'a Mapping)
fn visit_function(&mut self, input: &'a Function)
fn visit_stub(&mut self, input: &'a Stub)
fn visit_function_stub(&mut self, input: &'a FunctionStub)
fn visit_struct_stub(&mut self, input: &'a Composite)
fn visit_program(&mut self, input: &'a Program)
source§impl<'a> StatementVisitor<'a> for SymbolTableCreator<'a>
impl<'a> StatementVisitor<'a> for SymbolTableCreator<'a>
fn visit_statement(&mut self, input: &'a Statement)
fn visit_assert(&mut self, input: &'a AssertStatement)
fn visit_assign(&mut self, input: &'a AssignStatement)
fn visit_block(&mut self, input: &'a Block)
fn visit_conditional(&mut self, input: &'a ConditionalStatement)
fn visit_console(&mut self, input: &'a ConsoleStatement)
fn visit_const(&mut self, input: &'a ConstDeclaration)
fn visit_definition(&mut self, input: &'a DefinitionStatement)
fn visit_expression_statement(&mut self, input: &'a ExpressionStatement)
fn visit_iteration(&mut self, input: &'a IterationStatement)
fn visit_return(&mut self, input: &'a ReturnStatement)
Auto Trait Implementations§
impl<'a> Freeze for SymbolTableCreator<'a>
impl<'a> !RefUnwindSafe for SymbolTableCreator<'a>
impl<'a> !Send for SymbolTableCreator<'a>
impl<'a> !Sync for SymbolTableCreator<'a>
impl<'a> Unpin for SymbolTableCreator<'a>
impl<'a> !UnwindSafe for SymbolTableCreator<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more