blark.transform.StructureTypeDeclaration
- class blark.transform.StructureTypeDeclaration(name: Token, extends: Extends | None, indirection: IndirectionType | None, declarations: List[StructureElementDeclaration], meta: Meta | None = None)[source]
Bases:
object
Full structure type declaration, as part of a TYPE.
Examples:
TypeName EXTENDS Other.Type : STRUCT iValue : INT; END_STRUCT TypeName : POINTER TO STRUCT iValue : INT; END_STRUCT TypeName : POINTER TO STRUCT iValue : INT := 3 + 4; stTest : ST_Testing := (1, 2); eValue : E_Test := E_Test.ABC; arrValue : ARRAY [1..2] OF INT := [1, 2]; arrValue1 : INT (1..2); arrValue1 : (Value1 := 1) INT; sValue : STRING := 'abc'; iValue1 AT %I* : INT := 5; sValue1 : STRING[10] := 'test'; END_STRUCT
Lark grammar
This class is used by the following grammar rules:
structure_type_declaration
structure_type_declaration: structure_type_name_declaration [ extends ] ":" [ indirection_type ] "STRUCT"i ( structure_element_declaration ";"+ )* "END_STRUCT"i
Methods
__init__
(name, extends, indirection, ...[, meta])from_lark
(name, extends, indirection, ...)Attributes
- indirection: IndirectionType | None
- declarations: List[StructureElementDeclaration]
- static from_lark(name: Token, extends: Extends | None, indirection: IndirectionType | None, *declarations: StructureElementDeclaration)[source]