Struct donet_core::dcfile::interim::DCFile

source ·
pub(crate) struct DCFile {
    pub config: DCFileConfig,
    pub structs: Vec<DCStruct>,
    pub dclasses: Vec<DClass>,
    pub imports: Vec<PythonImport>,
    pub keywords: Vec<DCKeyword>,
    pub all_object_valid: bool,
    pub inherited_fields_stale: bool,
}
Expand description

DC file structure for internal use by the DC parser.

Fields§

§config: DCFileConfig§structs: Vec<DCStruct>§dclasses: Vec<DClass>§imports: Vec<PythonImport>§keywords: Vec<DCKeyword>§all_object_valid: bool§inherited_fields_stale: bool

Implementations§

source§

impl DCFile

source

pub fn add_field(&mut self, _field: DCField<'_>)

Assigns unique ID to the field for the scope of the entire DC file.

source

fn check_view_suffixes( pipeline: &mut PipelineData<'_>, view_suffixes: &Vec<ViewSuffix>, )

Redundancy check for an array of strings that represent view suffixes. The lexer already generates a specific token type for view suffixes, and the parser grammar expects this token type, so we already are guaranteed that the view suffixes are valid.

source

pub fn add_python_import( &mut self, pipeline: &mut PipelineData<'_>, import: PythonImport, )

‘Untangles’ a ast::PythonImport, which represents a python import line, into one or more PythonImport structures, which represent symbol imports from a python module (with view suffixes applied) and adds them to the DC file.

source

pub fn add_keyword( &mut self, pipeline: &mut PipelineData<'_>, keyword: KeywordDefinition, )

source

pub fn add_typedef(&mut self, _name: String) -> Result<(), ()>

source

pub fn add_dclass(&mut self, dclass: DClass)

source

pub fn add_struct(&mut self, _strct: DCStruct)

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.

Trait Implementations§

source§

impl Debug for DCFile

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'dc> From<DCFile> for DCFile<'dc>

source§

fn from(value: DCFile) -> Self

Converts to this type from the input type.
source§

impl From<DCFileConfig> for DCFile

source§

fn from(value: DCFileConfig) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for DCFile

§

impl !RefUnwindSafe for DCFile

§

impl !Send for DCFile

§

impl !Sync for DCFile

§

impl Unpin for DCFile

§

impl !UnwindSafe for DCFile

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.