blark.transform.UnionTypeDeclaration

class blark.transform.UnionTypeDeclaration(name: Token, declarations: List[UnionElementDeclaration], meta: Meta | None = None)[source]

Bases: object

A full declaration of a UNION type, as part of a TYPE/END_TYPE block.

Examples:

UNION
    iVal : INT;
    aAsBytes : ARRAY [0..2] OF BYTE;
END_UNION

UNION
    iValue : INT;
    eValue : (iValue := 1, iValue2 := 2) INT;
END_UNION

Lark grammar

This class is used by the following grammar rules:

union_type_declaration

union_type_declaration: structure_type_name_declaration ":" "UNION"i ( union_element_declaration ";"+ )* "END_UNION"i ";"*

Methods

__init__(name, declarations[, meta])

from_lark(name, *decls)

Attributes

meta

name

declarations

name: Token
declarations: List[UnionElementDeclaration]
meta: Meta | None = None
static from_lark(name: Token, *decls: UnionElementDeclaration)[source]
__init__(name: Token, declarations: List[UnionElementDeclaration], meta: Meta | None = None) None