Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

State Scope

State Scopes allow to define interface declarations and reactionsVariable Declarations, Signal Declarations, and Reactions

Interface Declarations

Declarations in a state interface scope are visible in this state and its descendant states.

Question: Are declarations with the same name allowed?

Declarations

Within State Scopes there can be declarations of variables (and signals)?.

...

VariableDefinition:
{VariableDefinition} direction=VarDirection? (isStatic?='static')? type=[types::Type|FQN] name=ID ('=' varInitialValue=Expression)? ('with' varCombineOperator=CombineOperator)?;

Examples:

 

 

 

Signals

4 views to implement signals:

...

 advantagedisadvantage
Don't use signals
  • no need to be implemented
  • no signals
Boolean variables as signals
  • implementation in a short time
  • a short form declaration:

    in I instead of in I:boolean

  • a short form of use:
    I / O instead of [I==true] / O = false
  • no more possible to use of Boolean variables
Yakindu events as signals
  • use of already implemented features
  • differ between Signals and Boolean Variables

Declaration: in signal I;

  • signals are implemented as events
  • Question: How to mix Signals and variables?
New declaration type
  • differ between Signals and Boolean Variables

Declaration: in signal I;

  • expensive

 

State Reactions

Entry

is an Effect.

EntryAction returns sgraph::Effect:
{EntryAction} 'Entry' ''/' effect=ReactionEffect ';';

Inside

is an Effect.

InsideAction returns sgraph::Effect:
{InsideAction} 'Inside'  '/' effect=ReactionEffect ';';

Exit

is an Effect

ExitAction returns sgraph::Effect:
{ExitAction} 'Exit'  '/' effect=ReactionEffect ';';

Suspend

is a Trigger.

Suspend returns sgraph::Trigger:
{Suspend} 'Suspend'  trigger=ReactionTrigger ';';


Transition

Question: use the commutativity of AND and OR?  if(A!=null &&  A.val=1)?