Skip to content

Commit ba8eb42

Browse files
committed
Improved documentation.
1 parent ba40207 commit ba8eb42

File tree

2 files changed

+42
-8
lines changed

2 files changed

+42
-8
lines changed

pyVHDLModel/SyntaxModel.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,6 +2215,7 @@ class SequentialStatement(Statement):
22152215
"""A ``SequentialStatement`` is a base-class for all sequential statements."""
22162216

22172217

2218+
# FIXME: Why not used in entity, architecture, package, package body, block-statement, generate-statements
22182219
@export
22192220
class ConcurrentDeclarations:
22202221
_declaredItems: List
@@ -2227,6 +2228,7 @@ def DeclaredItems(self) -> List:
22272228
return self._declaredItems
22282229

22292230

2231+
# FIXME: Why not used in entity, architecture, block-statement, generate-statements
22302232
@export
22312233
class ConcurrentStatements:
22322234
_statements: List[ConcurrentStatement]

pyVHDLModel/__init__.py

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,17 @@ def Documentation(self) -> Nullable[str]:
568568

569569
@export
570570
class DesignUnitWithContextMixin:
571-
_contextItems: List['ContextUnion']
572-
_libraryReferences: List['LibraryClause']
573-
_packageReferences: List['UseClause']
574-
_contextReferences: List['ContextReference']
571+
_contextItems: List['ContextUnion'] #: List of all context items (library, use and context clauses).
572+
_libraryReferences: List['LibraryClause'] #: List of library clauses.
573+
_packageReferences: List['UseClause'] #: List of use clauses.
574+
_contextReferences: List['ContextReference'] #: List of context clauses.
575575

576576
def __init__(self, contextItems: Iterable['ContextUnion'] = None):
577+
"""
578+
Initializes a mixin for design units with a context.
579+
580+
:param contextItems: A sequence of library, use or context clauses.
581+
"""
577582
from pyVHDLModel.SyntaxModel import LibraryClause, UseClause, ContextReference
578583

579584
self._contextItems = []
@@ -593,26 +598,53 @@ def __init__(self, contextItems: Iterable['ContextUnion'] = None):
593598

594599
@property
595600
def ContextItems(self) -> List['ContextUnion']:
601+
"""
602+
Read-only property to access the sequence of all context items comprising library, use and context clauses
603+
(:py:attr:`_contextItems`).
604+
605+
:returns: Sequence of context items.
606+
"""
596607
return self._contextItems
597608

609+
@property
610+
def ContextReferences(self) -> List['ContextReference']:
611+
"""
612+
Read-only property to access the sequence of context clauses (:py:attr:`_contextReferences`).
613+
614+
:returns: Sequence of context clauses.
615+
"""
616+
return self._contextReferences
617+
598618
@property
599619
def LibraryReferences(self) -> List['LibraryClause']:
620+
"""
621+
Read-only property to access the sequence of library clauses (:py:attr:`_libraryReferences`).
622+
623+
:returns: Sequence of library clauses.
624+
"""
600625
return self._libraryReferences
601626

602627
@property
603628
def PackageReferences(self) -> List['UseClause']:
604-
return self._packageReferences
629+
"""
630+
Read-only property to access the sequence of use clauses (:py:attr:`_packageReferences`).
605631
606-
@property
607-
def ContextReferences(self) -> List['ContextReference']:
608-
return self._contextReferences
632+
:returns: Sequence of use clauses.
633+
"""
634+
return self._packageReferences
609635

610636

611637
@export
612638
class DesignUnit(ModelEntity, NamedEntityMixin, DocumentedEntityMixin):
613639
"""A ``DesignUnit`` is a base-class for all design units."""
614640

615641
def __init__(self, identifier: str, documentation: str = None):
642+
"""
643+
Initializes a design unit.
644+
645+
:param identifier: Identifier (name) of the design unit.
646+
:param documentation: Associated documentation of the design unit.
647+
"""
616648
super().__init__()
617649
NamedEntityMixin.__init__(self, identifier)
618650
DocumentedEntityMixin.__init__(self, documentation)

0 commit comments

Comments
 (0)