pyGHDL.dom
Document object model (DOM) for pyGHDL.libghdl based on pyVHDLModel.
Submodules
- pyGHDL.dom.Aggregates
- pyGHDL.dom.Attribute
- pyGHDL.dom.Concurrent
- pyGHDL.dom.Configuration
- pyGHDL.dom.DesignUnit
- pyGHDL.dom.Expression
- pyGHDL.dom.InterfaceItem
- pyGHDL.dom.Literal
- pyGHDL.dom.Misc
- pyGHDL.dom.Name
- pyGHDL.dom.NonStandard
- pyGHDL.dom.Object
- pyGHDL.dom.PSL
- pyGHDL.dom.Range
- pyGHDL.dom.Sequential
- pyGHDL.dom.Subprogram
- pyGHDL.dom.Symbol
- pyGHDL.dom.Type
- pyGHDL.dom._Translate
- pyGHDL.dom._Utils
- pyGHDL.dom.formatting
Exceptions
DOMException: The exception is raised when an IIR node cannot be translated to a pyVHDLModel object.
Classes
Position: Represents the source code position of a IIR node in a source file.DOMMixin: Undocumented.
Exceptions
- exception pyGHDL.dom.DOMException(message='')[source]
The exception is raised when an IIR node cannot be translated to a pyVHDLModel object.
It reports a node kind the translation does not handle, or a node whose shape does not match what the surrounding construct expects. The message names the kind and, where available, the source position.
Inheritance
- Parameters:
message (str)
- Return type:
None
Classes
- class pyGHDL.dom.Position(filename, line, column)[source]
Represents the source code position of a IIR node in a source file.
Inheritance
- property Filename: Path
Read-only property to access the filename this source code position referres to (
_filename).- Returns:
The source code position’s filename.
- property Line: int
Read-only property to access the line number this source code position referres to (
_line).- Returns:
The source code position’s line.
- property Column: int
Read-only property to access the column this source code position referres to (
_column).- Returns:
The source code position’s column.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- class pyGHDL.dom.DOMMixin(node)[source]
Inheritance
- Parameters:
node (Iir)
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Position: <pyTooling.Decorators.readonly object at 0x7c526738b7d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.