The expression.py
module#
Summary#
Provides the top-level abstract class for expression trees. |
Provides the exception for empty expression trees. |
|
Provides the generic exception for syntax errors in expression trees. |
|
Provides the exception for incorrect identifiers. |
Return the expression tree for the higher-order construct for activating with initial values. |
|
Return the expression tree for the higher-order construct for activating with default values. |
|
Return the expression tree for a binary operator. |
|
Return the expression tree for a call to an operator. |
|
Return the expression tree for the case operator. |
|
Return the expression tree for the with operator. |
|
Return the expression tree for the concat operator. |
|
Return the expression tree for the data array operator. |
|
Return the expression tree for the data strictire operator. |
|
Return the expression tree for the init operator. |
|
Return the expression tree for flattening a structured value. |
|
Return the expression tree for the higher-order construct for fold creation. |
|
Return the expression tree for the higher-order construct for foldi creation. |
|
Return the expression tree for the higher-order construct for foldw creation. |
|
Return the expression tree for the higher-order construct for foldwi creation. |
|
Return the expression tree for a call to an operator. |
|
Return the expression tree for the if-then-else operator. |
|
Return the expression tree for the init operator. |
|
Return the expression tree for making a structured value. |
|
Return the expression tree for the higher-order construct for map creation. |
|
Return the expression tree for the higher-order construct for mapfold creation. |
|
Return the expression tree for the higher-order construct for mapfoldi creation. |
|
Return the expression tree for the higher-order construct for mapfoldw creation. |
|
Return the expression tree for the higher-order construct for mapfoldwi creation. |
|
Return the expression tree for the higher-order construct for mapi creation. |
|
Return the expression tree for the higher-order construct for mapw creation. |
|
Return the expression tree for the higher-order construct for mapdwi creation. |
|
Return the expression tree for a nary operator. |
|
Return the expression tree for the pre operator. |
|
Return the expression tree for the projection operator. |
|
Return the expression tree for the dynamic projection operator. |
|
Return the expression tree for the higher-order construct for restarting. |
|
Return the expression tree for the reverse operator. |
|
Return the expression tree for the scalar-to-vector operator. |
|
Return the expression tree for the slice operator. |
|
Return the expression tree for the times operator. |
|
Return the expression tree for the transpose operator. |
|
Return the expression tree for a unary operator. |
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 forExpressionTree
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.
Module detail#
- ET#
Short name for an
ExpressionTree
instance to simplify the declarations.
- EX#
Extended expression tree to simplify use of the create functions.
- LX#
Extended lists of expression trees to simply the use of create functions.