The ``expression.py`` module ============================ .. py:module:: ansys.scade.apitools.create.expression Summary ------- .. py:currentmodule:: expression .. tab-set:: .. tab-item:: Classes .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~ExpressionTree` - Provides the top-level abstract class for expression trees. .. tab-item:: Exceptions .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~EmptyTreeError` - Provides the exception for empty expression trees. * - :py:attr:`~ExprSyntaxError` - Provides the generic exception for syntax errors in expression trees. * - :py:attr:`~TypeIdentifierError` - Provides the exception for incorrect identifiers. .. tab-item:: Functions .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~create_activate` - Return the expression tree for the higher-order construct for activating with initial values. * - :py:attr:`~create_activate_no_init` - Return the expression tree for the higher-order construct for activating with default values. * - :py:attr:`~create_binary` - Return the expression tree for a binary operator. * - :py:attr:`~create_call` - Return the expression tree for a call to an operator. * - :py:attr:`~create_case` - Return the expression tree for the case operator. * - :py:attr:`~create_change_ith` - Return the expression tree for the with operator. * - :py:attr:`~create_concat` - Return the expression tree for the concat operator. * - :py:attr:`~create_data_array` - Return the expression tree for the data array operator. * - :py:attr:`~create_data_struct` - Return the expression tree for the data strictire operator. * - :py:attr:`~create_fby` - Return the expression tree for the init operator. * - :py:attr:`~create_flatten` - Return the expression tree for flattening a structured value. * - :py:attr:`~create_fold` - Return the expression tree for the higher-order construct for fold creation. * - :py:attr:`~create_foldi` - Return the expression tree for the higher-order construct for foldi creation. * - :py:attr:`~create_foldw` - Return the expression tree for the higher-order construct for foldw creation. * - :py:attr:`~create_foldwi` - Return the expression tree for the higher-order construct for foldwi creation. * - :py:attr:`~create_higher_order_call` - Return the expression tree for a call to an operator. * - :py:attr:`~create_if` - Return the expression tree for the if-then-else operator. * - :py:attr:`~create_init` - Return the expression tree for the init operator. * - :py:attr:`~create_make` - Return the expression tree for making a structured value. * - :py:attr:`~create_map` - Return the expression tree for the higher-order construct for map creation. * - :py:attr:`~create_mapfold` - Return the expression tree for the higher-order construct for mapfold creation. * - :py:attr:`~create_mapfoldi` - Return the expression tree for the higher-order construct for mapfoldi creation. * - :py:attr:`~create_mapfoldw` - Return the expression tree for the higher-order construct for mapfoldw creation. * - :py:attr:`~create_mapfoldwi` - Return the expression tree for the higher-order construct for mapfoldwi creation. * - :py:attr:`~create_mapi` - Return the expression tree for the higher-order construct for mapi creation. * - :py:attr:`~create_mapw` - Return the expression tree for the higher-order construct for mapw creation. * - :py:attr:`~create_mapwi` - Return the expression tree for the higher-order construct for mapdwi creation. * - :py:attr:`~create_nary` - Return the expression tree for a nary operator. * - :py:attr:`~create_pre` - Return the expression tree for the pre operator. * - :py:attr:`~create_prj` - Return the expression tree for the projection operator. * - :py:attr:`~create_prj_dyn` - Return the expression tree for the dynamic projection operator. * - :py:attr:`~create_restart` - Return the expression tree for the higher-order construct for restarting. * - :py:attr:`~create_reverse` - Return the expression tree for the reverse operator. * - :py:attr:`~create_scalar_to_vector` - Return the expression tree for the scalar-to-vector operator. * - :py:attr:`~create_slice` - Return the expression tree for the slice operator. * - :py:attr:`~create_times` - Return the expression tree for the times operator. * - :py:attr:`~create_transpose` - Return the expression tree for the transpose operator. * - :py:attr:`~create_unary` - Return the expression tree for a unary operator. .. tab-item:: Constants .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~ET` - Short name for an ``ExpressionTree`` instance to simplify the declarations. * - :py:attr:`~EX` - Extended expression tree to simplify use of the create functions. * - :py:attr:`~LX` - Extended lists of expression trees to simply the use of create functions. .. toctree:: :titlesonly: :maxdepth: 1 :hidden: 🝆 ExpressionTree .. toctree:: :titlesonly: :maxdepth: 1 :hidden: 🗲 EmptyTreeError 🗲 ExprSyntaxError 🗲 TypeIdentifierError .. toctree:: :titlesonly: :maxdepth: 1 :hidden: 𝑓(x) create_activate 𝑓(x) create_activate_no_init 𝑓(x) create_binary 𝑓(x) create_call 𝑓(x) create_case 𝑓(x) create_change_ith 𝑓(x) create_concat 𝑓(x) create_data_array 𝑓(x) create_data_struct 𝑓(x) create_fby 𝑓(x) create_flatten 𝑓(x) create_fold 𝑓(x) create_foldi 𝑓(x) create_foldw 𝑓(x) create_foldwi 𝑓(x) create_higher_order_call 𝑓(x) create_if 𝑓(x) create_init 𝑓(x) create_make 𝑓(x) create_map 𝑓(x) create_mapfold 𝑓(x) create_mapfoldi 𝑓(x) create_mapfoldw 𝑓(x) create_mapfoldwi 𝑓(x) create_mapi 𝑓(x) create_mapw 𝑓(x) create_mapwi 𝑓(x) create_nary 𝑓(x) create_pre 𝑓(x) create_prj 𝑓(x) create_prj_dyn 𝑓(x) create_restart 𝑓(x) create_reverse 𝑓(x) create_scalar_to_vector 𝑓(x) create_slice 𝑓(x) create_times 𝑓(x) create_transpose 𝑓(x) create_unary Description ----------- Provides helpers for creating expression trees. Expression trees are intermediate structures to declare any arbitrary complex expressions. They create the corresponding SCADE Suite expressions in the context of a model element, such as the right part of an equation or the default value of an output. This module provides functions to create an expression tree for any expression of the Scade language, including higher-order constructs. Thus, the intermediate structures or classes defining the expression trees can be opaque. Notes: The typing is relaxed in this module to ease the constructs. * ``ET`` is an alias for ``ExpressionTree`` to shorten the declarations. * ``EX``, which stands for extended expression tree, is defined as follows:: Union[bool, int, float, str, suite.ConstVar, suite.NamedType, ET] This enhances the usability of these functions by accepting some values, such as Python literals, string values, or SCADE Python objects, as valid expression trees. * ``LX``, which stands for extended lists of expression trees, is defined as follows:: Union[EX, List[EX]] When the expressions accept an arbitrary number of input flows, such as if-then-else or fby, you can provide either one expression tree or a list of expression trees. .. !! processed by numpydoc !! Module detail ------------- .. py:data:: ET Short name for an ``ExpressionTree`` instance to simplify the declarations. .. !! processed by numpydoc !! .. py:data:: EX Extended expression tree to simplify use of the create functions. .. !! processed by numpydoc !! .. py:data:: LX Extended lists of expression trees to simply the use of create functions. .. !! processed by numpydoc !!