CaseOp#

class CaseOp(expression)#

Bases: CallExpression

Provides the case expression.

Here is the format:

( case <switch> of ``
  | <pattern> :   <flow>
  | ...
  | <pattern> :   <flow>
  | _ :   <default>)

See the case_op example.

Parameters:
expression

Call expression to wrap.

Notes

The design differs slightly from the meta-model. The Case case used to implement the case collection is replaced by a tuple (pattern, flow).

A new property, default, provides the optional default value.

Overview#

cases

Pairs (Expression, Expression) to build the case.

default

Value to use as default when not None.

switch

Selector of the case expression.

Import detail#

from ansys.scade.apitools.expr.access import CaseOp

Property detail#

property cases: list[tuple[Expression, Expression]]#

Pairs (Expression, Expression) to build the case.

property default: Expression | None#

Value to use as default when not None.

property switch: Expression#

Selector of the case expression.