DCData

Struct DCData 

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

Implementations§

Source§

impl DCData

Source

pub fn register_symbol( &mut self, identifier: String, symbol_type: TopLevelSymbol, )

Inserts new key/value pair to the private symbol map.

Source

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.)

Source

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.

Source

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§

Source§

impl Default for DCData

Source§

fn default() -> DCData

Returns the “default value” for a type. Read more

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