Previous: , Up: Well-formedness – Data Parameters   [Contents][Index]


11.11.4 Formal binding is not a data member variable

Formal binding, which is the binding of a data member variable data to an event parameter p using the p <- data construct, is only allowed in a component, in an on context. Using <- in any other context is reported as a parse error.

extern int $int$;
interface ihello
{
  in void hello (int i);
  in void cruel (int i);
  behavior
  {
    on hello:;
    on cruel:;
  }
}

component parse_out_binding
{
  provides blocking ihello p;
  behavior
  {
    bool b = false;
    int data;
    blocking on p.hello (i <- data): {}
    blocking on p.cruel (b <- data): {}
    blocking on p.cruel (data <- i): {}
    blocking on p.cruel (k <- b): {}
  }
}

This results in the following error messages:

out-binding-reversed.dzn:22:26: error: formal binding `i' is not a data
    member variable
out-binding-reversed.dzn:23:26: error: formal binding `b' is not a data
    member variable