Struct libdonet::dcfile::intermediate::DCFile

source ·
pub struct DCFile {
    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§

§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 semantic_analysis(&self) -> Result<(), ()>

Performs a semantic analysis on the object and its children DC elements. In Panda, this is done on the go as you build the DC file tree. Due to how we build it in memory, (and the fact that we link all the objects together until we reduce to the root production in the CFG) we have to perform this analysis until the very end when all the elements are in the DCF struct.

source

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

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

source

pub fn add_python_import(&mut self, import: PythonImport)

source

pub fn add_keyword(&mut self, _keyword: DCKeyword)

source

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

source

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

source

pub fn get_num_dclasses(&mut self) -> usize

source

pub fn get_next_dclass_id(&mut self) -> DClassId

source

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

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 Default for DCFile

source§

fn default() -> Self

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

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

§

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

§

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.