Operator instance#
An OperatorInstance
object is an Expression
object
representing an operator instance call, the called operator being represented
by an instance of the top-level class OperatorBase
Operator instance class diagram#
Higher-order operations (operations using an operator as parameter) are
represented by instances of the OperatorExpression
class.
Operator higher-order class diagram#
- class ansys.scadeone.core.swan.OperatorBase(sizes: List[Expression])#
-
Base class for: operator ::= prefix_op [[sizes]].
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- 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.
- property sizes: List[Expression]#
Size parameters of call.
Operator instance application#
- class ansys.scadeone.core.swan.OperatorInstance(operator: OperatorBase, params: Group, luid: Luid | None = None)#
Bases:
Expression
Operator instance call:
expr := operator_instance ( group )
operator_instance ::= operator [[ luid ]]
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- 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 operator: OperatorBase#
Called operator.
- property owner: Self#
Owner of current Swan construct.
Named operator instance#
- class ansys.scadeone.core.swan.PathIdOpCall(path_id: PathIdentifier, sizes: List[Expression], pragmas: List[Pragma])#
Bases:
OperatorBase
,PragmaBase
Call to user-defined operator: operator ::= path_id [[sizes]].
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- 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.
- property path_id: PathIdentifier#
Operator path.
- property sizes: List[Expression]#
Size parameters of call.
Anonymous operator instance#
- class ansys.scadeone.core.swan.AnonymousOperatorWithExpression(is_node: bool, params: List[Identifier], sections: List[ScopeSection], expr: Expression)#
Bases:
OperatorExpression
Anonymous operator expression: ((node|function)) id {{ , id }} scope_sections => expr.
- 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#
Anonymous operator body.
- property is_node#
True when anonymous operator is a node, else a function.
- 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.
- property params: List[Identifier]#
Anonymous operator parameters list.
- property sections: List[ScopeSection]#
Scope sections list.
- class ansys.scadeone.core.swan.AnonymousOperatorWithDataDefinition(is_node: bool, inputs: List[VarDecl], outputs: List[VarDecl], data_def: Equation | Scope)#
Bases:
OperatorExpression
Anonymous operator expression: ((node|function)) params returns params data_def.
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- property data_def: Equation | Scope#
Anonymous operator data definition, either an equation or a scope.
- property is_node#
True when anonymous operator is a node, else a function.
- 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.
Higher-order operator instance#
Higher-order |
Application |
---|---|
map, fold, mapfold, mapi foldi, mapfoldi |
array iterators |
activate operator expression every |
conditional activation |
restart operator expression every |
conditional restart |
Iterator#
- class ansys.scadeone.core.swan.Iterator(kind: IteratorKind, operator: OperatorBase)#
Bases:
OperatorExpression
Iterators: map, fold, mapfold, mapi, foldi, mapfoldi.
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- 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 kind: IteratorKind#
Iterator kind.
- property module: ModuleBase#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBody
andModuleInterface
- property operator: OperatorBase#
Iterated operator.
- property owner: Self#
Owner of current Swan construct.
Activate#
- class ansys.scadeone.core.swan.ActivateEvery(operator: OperatorBase, condition: Expression, is_last: bool, expr: Expression)#
Bases:
OperatorExpression
Higher-order activate expression: activate operator every expr (( last**| **default )) expr.
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- property condition: Expression#
Activation condition.
- property expr: Expression#
Activation default/last 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 operator: OperatorBase#
Operator under activation.
- property owner: Self#
Owner of current Swan construct.
Restart#
- class ansys.scadeone.core.swan.Restart(operator: OperatorBase, condition: Expression)#
Bases:
OperatorExpression
Higher-order restart expression: restart operator every expr.
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- property condition: Expression#
Activation condition.
- 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 operator: OperatorBase#
Operator under activation.
- property owner: Self#
Owner of current Swan construct.
Partial operator instance#
- class ansys.scadeone.core.swan.Partial(operator: OperatorBase, partial_group: List[OptGroupItem])#
Bases:
OperatorExpression
Partial operator expression: operator partial_group.
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- 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 operator: OperatorBase#
Called operator.
- property owner: Self#
Owner of current Swan construct.
- property partial_group: List[OptGroupItem]#
Returns the partial group items.
- class ansys.scadeone.core.swan.OptGroupItem(item: GroupItem | None = None)#
Bases:
SwanItem
Optional group item: opt_group_item ::= _ | group_item.
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- 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.
N-ary operator instance#
N-ary operator instances are implemented as specific expressions. See N-ary expressions section.
Operator Expressions#
- class ansys.scadeone.core.swan.OperatorExpression#
-
Base class for op_expr.
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- 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.
- class ansys.scadeone.core.swan.PrefixOperatorExpression(op_expr: OperatorExpression, sizes: List[Expression])#
Bases:
OperatorBase
Call to op_expr: operator ::= (op_expr) [[sizes]].
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- 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 op_expr: OperatorExpression#
Operator expression.
- property owner: Self#
Owner of current Swan construct.
- property sizes: List[Expression]#
Size parameters of call.
This class is used when an operator expression is syntactically incorrect and was protected by the serialization process.
- class ansys.scadeone.core.swan.ProtectedOpExpr(data: str, markup: str)#
Bases:
OperatorExpression
,ProtectedItem
Protected operator expression, i.e., saved as string if syntactically incorrect.
- static set_owner(owner: Self, children: Self | Iterable[Self])#
Helper to set owner as the owner of each item in the Iterable items.
- property is_protected#
Tell if item is syntactically protected and provided as a string.
- property module: ModuleBase#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBody
andModuleInterface
- property owner: Self#
Owner of current Swan construct.