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
impl DCFile
sourcepub fn add_field(&mut self, _field: DCField<'_>)
pub fn add_field(&mut self, _field: DCField<'_>)
Assigns unique ID to the field for the scope of the entire DC file.
sourcefn check_view_suffixes(
pipeline: &mut PipelineData<'_>,
view_suffixes: &Vec<ViewSuffix>,
)
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.
sourcepub fn add_python_import(
&mut self,
pipeline: &mut PipelineData<'_>,
import: PythonImport,
)
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.
pub fn add_keyword( &mut self, pipeline: &mut PipelineData<'_>, keyword: KeywordDefinition, )
pub fn add_typedef(&mut self, _name: String) -> Result<(), ()>
pub fn add_dclass(&mut self, dclass: DClass)
pub fn add_struct(&mut self, _strct: DCStruct)
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.