pub struct SymbolTable {
pub name: String,
pub typ: SymbolTableType,
pub line_number: u32,
pub is_nested: bool,
pub symbols: IndexMap<String, Symbol, RandomState>,
pub sub_tables: Vec<SymbolTable>,
}
Expand description
Captures all symbols in the current scope, and has a list of sub-scopes in this scope.
Fields§
§name: String
The name of this symbol table. Often the name of the class or function.
typ: SymbolTableType
The type of symbol table
line_number: u32
The line number in the source code where this symboltable begins.
is_nested: bool
§symbols: IndexMap<String, Symbol, RandomState>
A set of symbols present on this scope level.
sub_tables: Vec<SymbolTable>
A list of sub-scopes in the order as found in the AST nodes.
Implementations§
Source§impl SymbolTable
impl SymbolTable
pub fn scan_program( program: &[Stmt<SourceRange>], ) -> Result<SymbolTable, SymbolTableError>
pub fn scan_expr( expr: &Expr<SourceRange>, ) -> Result<SymbolTable, SymbolTableError>
Trait Implementations§
Source§impl Clone for SymbolTable
impl Clone for SymbolTable
Source§fn clone(&self) -> SymbolTable
fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for SymbolTable
impl RefUnwindSafe for SymbolTable
impl Send for SymbolTable
impl Sync for SymbolTable
impl Unpin for SymbolTable
impl UnwindSafe for SymbolTable
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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