blark.transform.ArraySpecification

class blark.transform.ArraySpecification(subranges: List[Subrange], type: DataType | FunctionCall | ObjectInitializerArray | ArraySpecification | StringTypeSpecification, meta: Meta | None = None)[source]

Bases: TypeSpecificationBase

An array specification.

Examples:

ARRAY[*] OF TypeName
ARRAY[1..2] OF Call(1, 2)
ARRAY[1..2] OF Call(1, 2)
ARRAY[1..5] OF Vec(SIZEOF(TestStruct), 0)
ARRAY[1..5] OF STRING[10]
ARRAY[1..5] OF STRING(Param.iLower)

Lark grammar

This class is used by the following grammar rules:

array_specification

array_specification: "ARRAY"i "[" subrange ( "," subrange )* "]" "OF"i _array_spec_type

Methods

__init__(subranges, type[, meta])

from_lark(*args)

Attributes

base_type_name

The base type name.

full_type_name

The full type name.

meta

type_info

The base type name.

subranges

type

subranges: List[Subrange]
type: DataType | FunctionCall | ObjectInitializerArray | ArraySpecification | StringTypeSpecification
meta: Meta | None = None
property base_type_name: str | Token

The base type name.

property full_type_name: str

The full type name.

static from_lark(*args)[source]
__init__(subranges: List[Subrange], type: DataType | FunctionCall | ObjectInitializerArray | ArraySpecification | StringTypeSpecification, meta: Meta | None = None) None