pyGHDL.libghdl.file_comments
Variables
Functions
Find_First_Comment(): Get the first comment associated to a node.Get_Comment_Start(): Get the start of commentGet_Comment_Last(): Get the end of commentGet_Next_Comment(): Get the next comment
Variables
- pyGHDL.libghdl.file_comments.Comment_Index
Type variable.
The preferred way to construct a type variable is via the dedicated syntax for generic functions, classes, and type aliases:
class Sequence[T]: # T is a TypeVar ...
This syntax can also be used to create bound and constrained type variables:
# S is a TypeVar bound to str class StrSequence[S: str]: ... # A is a TypeVar constrained to str or bytes class StrOrBytesSequence[A: (str, bytes)]: ...
Type variables can also have defaults:
- class IntDefault[T = int]:
…
However, if desired, reusable type variables can also be constructed manually, like so:
T = TypeVar('T') # Can be anything S = TypeVar('S', bound=str) # Can be any subtype of str A = TypeVar('A', str, bytes) # Must be exactly str or bytes D = TypeVar('D', default=int) # Defaults to int
Type variables exist primarily for the benefit of static type checkers. They serve as the parameters for generic types as well as for generic function and type alias definitions.
The variance of type variables is inferred by type checkers when they are created through the type parameter syntax and when
infer_variance=Trueis passed. Manually created type variables may be explicitly marked covariant or contravariant by passingcovariant=Trueorcontravariant=True. By default, manually created type variables are invariant. See PEP 484 and PEP 695 for more details.~Comment_Index
- pyGHDL.libghdl.file_comments.No_Comment_Index
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer iteral. >>> int(‘0b100’, base=0) 4
0
Functions
- pyGHDL.libghdl.file_comments.Find_First_Comment(File, N)[source]
Get the first comment associated to a node. :type N:
c_uint:param N: Node :type File:TypeVar(SourceFileEntry, bound=c_uint) :param File: Source file for node- Return type:
- Returns:
The first comment index, or No_Comment_Index if none.
- Parameters:
File (SourceFileEntry)
N (c_uint)
- pyGHDL.libghdl.file_comments.Get_Comment_Start(File, Idx)[source]
Get the start of comment
- Return type:
- Parameters:
File (SourceFileEntry)
Idx (Comment_Index)
- pyGHDL.libghdl.file_comments.Get_Comment_Last(File, Idx)[source]
Get the end of comment
- Return type:
- Parameters:
File (SourceFileEntry)
Idx (Comment_Index)
- pyGHDL.libghdl.file_comments.Get_Next_Comment(File, Idx)[source]
Get the next comment
- Return type:
- Parameters:
File (SourceFileEntry)
Idx (Comment_Index)