Functional update#
Functional update is the modification of an array or a structure with the creation of a new value.
Operation |
Kind |
---|---|
_ with [_] |
Array |
_ with .l |
Structure |
See also LabelOrIndex
.
- class ansys.scadeone.core.swan.Modifier(modifier: List[LabelOrIndex] | str, expr: Expression)#
Bases:
SwanItem
Modifier expression: {{ label_or_index }}+ = expr.
Label of index can be syntactically incorrect. In which case, _modifier_ is a string, and is_protected property is True.
See
FunctionalUpdate
.- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- property expr: Expression#
Modifier expression.
- property is_protected#
Modifier has a syntax error and is protected.
- property modifier: List[LabelOrIndex] | str#
Modifier as label or index.
- property module: ModuleBase#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBody
andModuleInterface
- property owner: Self#
Owner of current Swan construct.
- class ansys.scadeone.core.swan.FunctionalUpdate(expr: Expression, modifiers: List[Modifier])#
Bases:
Expression
Copy with modification: ( expr with modifier {{ ; modifier }} [[ ; ]] ).
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- property expr: Expression#
Expression.
- property is_protected: bool#
Tell if a construct item is syntactically protected with some markup and is stored as a string (without the markup).
- property module: ModuleBase#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBody
andModuleInterface
- property owner: Self#
Owner of current Swan construct.