Expressions#
Expressions are implemented with classes that have Expression
as top-level class.
Protected expressions are implemented as ProtectedExpr
.
Groups as defined in Group are also Expression
.
- class ansys.scadeone.core.swan.Expression#
Bases:
SwanItem
Base class for expressions.
- static set_owner(owner: SwanItem | IProject | None, children: SwanItem | Iterable[SwanItem]) None #
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 | None#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBody
andModuleInterface
or None if the object is itself a module.
- class ansys.scadeone.core.swan.ProtectedExpr(data: str, markup: str | None = 'syntax')#
Bases:
Expression
,ProtectedItem
Protected expression, i.e., saved as string if syntactically incorrect.
- static set_owner(owner: SwanItem | IProject | None, children: SwanItem | Iterable[SwanItem]) None #
Helper to set owner as the owner of each item in the Iterable items.
- property module: ModuleBase | None#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBody
andModuleInterface
or None if the object is itself a module.