pyGHDL.dom.Name
This module implements derived name classes from pyVHDLModel.Name.
Classes
SimpleName: Represents a single name (identifier) to a language entity.ParenthesisName: Represents a parenthesis (index access or function call) following a name.IndexedName: Represents a name indexing an array by one or more values.SlicedName: Represents a slice following a name.SelectedName: Represents a name following a name in dot-notation.AttributeName: Represents a name following a name in tick-notation.AllName: Represents a keywordallfollowing a name in dot-notation.OpenName: Represents the keywordopenused as a special name.
Classes
- class pyGHDL.dom.Name.SimpleName(node, identifier)[source]
Represents a single name (identifier) to a language entity.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Name.SimpleName.Example
ieeeInheritance
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- 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 HasPrefix: bool
Check if the name has a prefix, i.e.
_prefixis set.This is true for all names except
simple names.- Returns:
True, if the name has a prefix.
- property Identifier: str
Read-only property to access the identifier this name references (
_identifier).- Returns:
The referenced identifier.
- property NormalizedIdentifier: str
Read-only property to access the normalized identifier this name references (
_normalizedIdentifier).- Returns:
The referenced identifier (normalized).
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- 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.
- property Prefix: Name | None
Read-only property to access the name’s prefix in a chain of names (
_prefix).- Returns:
The name left from current name, if not a simple name, otherwise
None.
- property Root: Name
Read-only property to access the root (left-most) element in a chain of names (
_root).In case the name is a
simple name, the root points to the name itself.- Returns:
The name’s root element.
- __repr__()
Formats a representation of the name.
Format:
Name: 'sig'- Return type:
- Returns:
String representation of the name.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Name.ParenthesisName(node, prefix, associations)[source]
Represents a parenthesis (index access or function call) following a name.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Name.ParenthesisName.Example
arr(0) -- ^^^
Inheritance
- __init__(node, prefix, associations)[source]
Initializes a name followed by a parenthesized association list.
- property Associations: List
Read-only property to access the associations (
_associations).- Returns:
List of associations.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- 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 HasPrefix: bool
Check if the name has a prefix, i.e.
_prefixis set.This is true for all names except
simple names.- Returns:
True, if the name has a prefix.
- property Identifier: str
Read-only property to access the identifier this name references (
_identifier).- Returns:
The referenced identifier.
- property NormalizedIdentifier: str
Read-only property to access the normalized identifier this name references (
_normalizedIdentifier).- Returns:
The referenced identifier (normalized).
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- 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.
- property Prefix: Name | None
Read-only property to access the name’s prefix in a chain of names (
_prefix).- Returns:
The name left from current name, if not a simple name, otherwise
None.
- property Root: Name
Read-only property to access the root (left-most) element in a chain of names (
_root).In case the name is a
simple name, the root points to the name itself.- Returns:
The name’s root element.
- __repr__()
Formats a representation of the name.
Format:
Name: 'sig'- Return type:
- Returns:
String representation of the name.
- __str__()[source]
Formats the parenthesis name.
Format:
func(a, b)- Return type:
- Returns:
Formatted parenthesis name.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Name.IndexedName(node, identifier)[source]
Inheritance
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- 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 HasPrefix: bool
Check if the name has a prefix, i.e.
_prefixis set.This is true for all names except
simple names.- Returns:
True, if the name has a prefix.
- property Identifier: str
Read-only property to access the identifier this name references (
_identifier).- Returns:
The referenced identifier.
- property Indices: List[BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal]
Read-only property to access the indices (
_indices).- Returns:
List of indices.
- property NormalizedIdentifier: str
Read-only property to access the normalized identifier this name references (
_normalizedIdentifier).- Returns:
The referenced identifier (normalized).
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- 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.
- property Prefix: Name | None
Read-only property to access the name’s prefix in a chain of names (
_prefix).- Returns:
The name left from current name, if not a simple name, otherwise
None.
- property Root: Name
Read-only property to access the root (left-most) element in a chain of names (
_root).In case the name is a
simple name, the root points to the name itself.- Returns:
The name’s root element.
- __repr__()
Formats a representation of the name.
Format:
Name: 'sig'- Return type:
- Returns:
String representation of the name.
- __str__()[source]
Formats the indexed name.
Format:
arr(0)- Return type:
- Returns:
Formatted indexed name.
- _identifier
The name’s identifier.
- _indices
List of all index expressions, one per dimension.
- _normalizedIdentifier
The normalized (lower case) identifier.
- _parent
Reference to a parent entity in the logical model hierarchy.
- _prefix
Reference to the name’s prefix, or
Nonefor a simple name.
- _root
Reference to the root of the name chain.
- class pyGHDL.dom.Name.SlicedName(node, identifier)[source]
Represents a slice following a name.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Name.SlicedName.Example
arr(7 downto 0) -- ^^^^^^^^^^^^
Inheritance
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- 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 HasPrefix: bool
Check if the name has a prefix, i.e.
_prefixis set.This is true for all names except
simple names.- Returns:
True, if the name has a prefix.
- property Identifier: str
Read-only property to access the identifier this name references (
_identifier).- Returns:
The referenced identifier.
- property NormalizedIdentifier: str
Read-only property to access the normalized identifier this name references (
_normalizedIdentifier).- Returns:
The referenced identifier (normalized).
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- 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.
- property Prefix: Name | None
Read-only property to access the name’s prefix in a chain of names (
_prefix).- Returns:
The name left from current name, if not a simple name, otherwise
None.
- property Root: Name
Read-only property to access the root (left-most) element in a chain of names (
_root).In case the name is a
simple name, the root points to the name itself.- Returns:
The name’s root element.
- __repr__()
Formats a representation of the name.
Format:
Name: 'sig'- Return type:
- Returns:
String representation of the name.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Name.SelectedName(node, identifier, prefix)[source]
Represents a name following a name in dot-notation.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Name.SelectedName.Example
rec.elem -- ^^^^^
Inheritance
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- 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 HasPrefix: bool
Check if the name has a prefix, i.e.
_prefixis set.This is true for all names except
simple names.- Returns:
True, if the name has a prefix.
- property Identifier: str
Read-only property to access the identifier this name references (
_identifier).- Returns:
The referenced identifier.
- property NormalizedIdentifier: str
Read-only property to access the normalized identifier this name references (
_normalizedIdentifier).- Returns:
The referenced identifier (normalized).
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- 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.
- property Prefix: Name | None
Read-only property to access the name’s prefix in a chain of names (
_prefix).- Returns:
The name left from current name, if not a simple name, otherwise
None.
- property Root: Name
Read-only property to access the root (left-most) element in a chain of names (
_root).In case the name is a
simple name, the root points to the name itself.- Returns:
The name’s root element.
- __repr__()
Formats a representation of the name.
Format:
Name: 'sig'- Return type:
- Returns:
String representation of the name.
- __str__()[source]
Formats the selected name.
Format:
rec.elem- Return type:
- Returns:
Formatted selected name.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Name.AttributeName(node, identifier, prefix)[source]
Represents a name following a name in tick-notation.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Name.AttributeName.Example
arr'length -- ^^^^^^^
Inheritance
- __init__(node, identifier, prefix)[source]
Initializes a name selecting an attribute of its prefix.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- 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 HasPrefix: bool
Check if the name has a prefix, i.e.
_prefixis set.This is true for all names except
simple names.- Returns:
True, if the name has a prefix.
- property Identifier: str
Read-only property to access the identifier this name references (
_identifier).- Returns:
The referenced identifier.
- property NormalizedIdentifier: str
Read-only property to access the normalized identifier this name references (
_normalizedIdentifier).- Returns:
The referenced identifier (normalized).
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- 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.
- property Prefix: Name | None
Read-only property to access the name’s prefix in a chain of names (
_prefix).- Returns:
The name left from current name, if not a simple name, otherwise
None.
- property Root: Name
Read-only property to access the root (left-most) element in a chain of names (
_root).In case the name is a
simple name, the root points to the name itself.- Returns:
The name’s root element.
- __repr__()
Formats a representation of the name.
Format:
Name: 'sig'- Return type:
- Returns:
String representation of the name.
- __str__()[source]
Formats the attribute name.
Format:
v'range- Return type:
- Returns:
Formatted attribute name.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Name.AllName(node, prefix)[source]
Represents a keyword
allfollowing a name in dot-notation.This class implements a
pyGHDL.domobject derived frompyVHDLModel.Name.AllName.Example
ptr.all -- ^^^^
Inheritance
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- 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 HasPrefix: bool
Check if the name has a prefix, i.e.
_prefixis set.This is true for all names except
simple names.- Returns:
True, if the name has a prefix.
- property Identifier: str
Read-only property to access the identifier this name references (
_identifier).- Returns:
The referenced identifier.
- property NormalizedIdentifier: str
Read-only property to access the normalized identifier this name references (
_normalizedIdentifier).- Returns:
The referenced identifier (normalized).
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- 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.
- property Prefix: Name | None
Read-only property to access the name’s prefix in a chain of names (
_prefix).- Returns:
The name left from current name, if not a simple name, otherwise
None.
- property Root: Name
Read-only property to access the root (left-most) element in a chain of names (
_root).In case the name is a
simple name, the root points to the name itself.- Returns:
The name’s root element.
- __repr__()
Formats a representation of the name.
Format:
Name: 'sig'- Return type:
- Returns:
String representation of the name.
- __str__()
Formats the selected name.
Format:
rec.elem- Return type:
- Returns:
Formatted selected name.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Name.OpenName(node)[source]
Represents the keyword
openused as a special name.This class implements a
pyGHDL.domobject derived frompyVHDLModel.Name.OpenName.Example
openInheritance
- Parameters:
node (Iir)
- __init__(node)[source]
Initializes an
openname.- Parameters:
parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- 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 HasPrefix: bool
Check if the name has a prefix, i.e.
_prefixis set.This is true for all names except
simple names.- Returns:
True, if the name has a prefix.
- property Identifier: str
Read-only property to access the identifier this name references (
_identifier).- Returns:
The referenced identifier.
- property NormalizedIdentifier: str
Read-only property to access the normalized identifier this name references (
_normalizedIdentifier).- Returns:
The referenced identifier (normalized).
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- 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.
- property Prefix: Name | None
Read-only property to access the name’s prefix in a chain of names (
_prefix).- Returns:
The name left from current name, if not a simple name, otherwise
None.
- property Root: Name
Read-only property to access the root (left-most) element in a chain of names (
_root).In case the name is a
simple name, the root points to the name itself.- Returns:
The name’s root element.
- __repr__()
Formats a representation of the name.
Format:
Name: 'sig'- Return type:
- Returns:
String representation of the name.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.