blark.transform.DirectVariable

class blark.transform.DirectVariable(location_prefix: VariableLocationPrefix, location: Token, size_prefix: VariableSizePrefix, bits: List[Token] | None = None, meta: Meta | None = None)[source]

Bases: Variable

Direct variables with I/O linkage.

Example: var AT %I*

May be located (e.g., AT %IX1.1) or incomplete (e.g., just %I*).

Lark grammar

This class is used by the following grammar rules:

direct_variable

direct_variable: "%" LOCATION_PREFIX [ SIZE_PREFIX ] INTEGER ( "." INTEGER )*

Methods

__init__(location_prefix, location, size_prefix)

from_lark(location_prefix, size_prefix, ...)

Attributes

bits

The number of bits.

meta

Lark metadata.

location_prefix

The location prefix (e.g., I, Q, or M)

location

The location number itself (e.g., 2 of %IX2.1)

size_prefix

Size prefix, used in locations (e.g., %IX1.1 has a bit prefix).

location_prefix: VariableLocationPrefix

The location prefix (e.g., I, Q, or M)

location: Token

The location number itself (e.g., 2 of %IX2.1)

size_prefix: VariableSizePrefix

Size prefix, used in locations (e.g., %IX1.1 has a bit prefix).

bits: List[Token] | None = None

The number of bits.

meta: Meta | None = None

Lark metadata.

static from_lark(location_prefix: Token, size_prefix: Token | None, location: Token, *bits: Token)[source]
__init__(location_prefix: VariableLocationPrefix, location: Token, size_prefix: VariableSizePrefix, bits: List[Token] | None = None, meta: Meta | None = None) None