Constant declaration#
- class ansys.scadeone.core.swan.ConstDecl(id: Identifier, type: TypeExpression | None, value: Expression | None = None, pragmas: list[Pragma] | None = None)#
Bases:
DeclarationConstant declaration, with an id, a type, and an optional expression.
- static set_owner(owner: SwanItem | IModel | None, children: SwanItem | Iterable[SwanItem] | None) None#
Helper to set owner as the owner of each item in the Iterable items.
- property id: Identifier#
Language item identifier.
- 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 model: IModel#
Return model containing the Swan item.
- property module: ModuleBase | None#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBodyandModuleInterfaceor None if the object is itself a module.
- property type: TypeExpression | None#
Type of constant.
- property value: Expression | None#
Constant optional value. None if undefined.
- class ansys.scadeone.core.swan.ConstDeclarations(constants: List[ConstDecl])#
Bases:
GlobalDeclarationConstant declarations: constant {{ constant_decl ; }}.
- static set_owner(owner: SwanItem | IModel | None, children: SwanItem | Iterable[SwanItem] | None) 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 model: IModel#
Return model containing the Swan item.
- property module: ModuleBase | None#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBodyandModuleInterfaceor None if the object is itself a module.