pub struct DCData {
symbol_map: MultiMap<String, TopLevelSymbol>,
next_dclass_id: DClassId,
next_field_id: FieldId,
}Expand description
Globals that the semantic analyzer uses while parsing the abstract syntax tree.
Fields§
§symbol_map: MultiMap<String, TopLevelSymbol>§next_dclass_id: DClassId§next_field_id: FieldIdImplementations§
Source§impl DCData
impl DCData
Sourcepub fn register_symbol(
&mut self,
identifier: String,
symbol_type: TopLevelSymbol,
)
pub fn register_symbol( &mut self, identifier: String, symbol_type: TopLevelSymbol, )
Inserts new key/value pair to the private symbol map.
Sourcepub fn symbol_exists(
&self,
identifier: &String,
symbol_type: TopLevelSymbol,
) -> bool
pub fn symbol_exists( &self, identifier: &String, symbol_type: TopLevelSymbol, ) -> bool
Check is a given symbol exists in our symbol map (a.k.a it is a registered type declaration in the DC file.)
Sourcepub fn get_next_dclass_id(
&mut self,
pipeline: &mut PipelineData<'_>,
dclass: DClass,
) -> Result<DClassId>
pub fn get_next_dclass_id( &mut self, pipeline: &mut PipelineData<'_>, dclass: DClass, ) -> Result<DClassId>
Gets the next dclass ID based on the current allocated IDs.
If an error is returned, this DC file has run out of dclass IDs to assign. This function will emit the error diagnostic.
Sourcepub fn get_next_field_id(
&mut self,
pipeline: &mut PipelineData<'_>,
field_span: Span,
) -> Result<FieldId>
pub fn get_next_field_id( &mut self, pipeline: &mut PipelineData<'_>, field_span: Span, ) -> Result<FieldId>
Gets the next field ID based on the current allocated IDs.
If an error is returned, this DC file has run out of field IDs to assign. This function will emit the error diagnostic.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DCData
impl RefUnwindSafe for DCData
impl Send for DCData
impl Sync for DCData
impl Unpin for DCData
impl UnwindSafe for DCData
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