Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

State Scope

State Scopes allow to define interface declarations and reactions

Interface Declarations

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

+

Declarations

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

A Variable:

  • has an optional (not direction for local variables) direction, 
  • can be static, 
  • has a datatype (integer, boolean, real, string, void)
  • an optional initial value
  • has a CombineOperator (-, +, *, max, min, or, and, host).

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

Examples:

Signals

4 views to implement signals:

  • don't use signals. Use only variables
  • Boolean variables are interpreted as signals (no Boolean variables available)
  • Yakindu events are interpreted as signals
  • declare a new declarations type named signal

 

 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
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


  • No labels