Document
- class Document
-
Members defined in
Document(7 members)
R
Returns the iterator to all nodes in this document that are instances of
kind, including all subtypes.
Create a document for multi-threaded applications. This allows the
Executorto release GIL during execution allowing other Python threads to execute in the meantime but only if all the other documents were also created withcreate_mt.
Create a document for single-threaded applications. Note that this disables GIL optimization during
Executor.runusing this document.
Returns the iterator to nodes in this documents that are instances of
kind, excluding any subtypes.
Parse a document from string for multi-threaded applications without resolving references. This allows the
Executorto release GIL during execution allowing other Python threads to execute in the meantime but only if all the other documents were also created withcreate_mt.
Parse a document from string for single-threaded applications without resolving references. Note that this disables GIL optimization during
Executor.runusing this document.Members inherited from
BasicDocument(11 members)
RW
R
R
R
RRetrieve the mutex associated with this document
RW
RW
RThe version of the last build. This corresponds to the version of
TextDocumentthis was built from.
Set
document_tierto another value. This is a method rather than a function because tier should not change throughout document lifetime. Nevertheless, this is still useful in cases where a document has just been constructed and its attributes need to be changed.
Increment sema version. Source version is automatically handled by source parser.
Attributes
- property root_node: syside.Namespace
Methods
- all_nodes(kind: type[syside.TElement]) Iterable[syside.TElement]
Returns the iterator to all nodes in this document that are instances of
kind, including all subtypes.
- static create_mt() syside.SharedMutex[syside.Document]
Create a document for multi-threaded applications. This allows the
Executorto release GIL during execution allowing other Python threads to execute in the meantime but only if all the other documents were also created withcreate_mt.
- static create_mt(arg: syside.DocumentOptions, /) syside.SharedMutex[syside.Document]
- static create_mt(url: syside.Url, language: syside.ModelLanguage, tier: syside.DocumentTier = DocumentTier.Project, document_id: syside.DocumentID | None = None, owning_library: syside.LibraryID | None = None) syside.SharedMutex[syside.Document]
- static create_st() syside.SharedMutex[syside.Document]
Create a document for single-threaded applications. Note that this disables GIL optimization during
Executor.runusing this document.
- static create_st(arg: syside.DocumentOptions, /) syside.SharedMutex[syside.Document]
- static create_st(url: syside.Url, language: syside.ModelLanguage, tier: syside.DocumentTier = DocumentTier.Project, document_id: syside.DocumentID | None = None, owning_library: syside.LibraryID | None = None) syside.SharedMutex[syside.Document]
- nodes(kind: type[syside.TElement]) Iterable[syside.TElement]
Returns the iterator to nodes in this documents that are instances of
kind, excluding any subtypes.
- static parse_string_mt(source: str, language: syside.ModelLanguage) tuple[syside.SharedMutex[syside.Document], list[syside.Diagnostic]]
Parse a document from string for multi-threaded applications without resolving references. This allows the
Executorto release GIL during execution allowing other Python threads to execute in the meantime but only if all the other documents were also created withcreate_mt.
- static parse_string_st(source: str, language: syside.ModelLanguage) tuple[syside.SharedMutex[syside.Document], list[syside.Diagnostic]]
Parse a document from string for single-threaded applications without resolving references. Note that this disables GIL optimization during
Executor.runusing this document.