OEP

125

Title

Tag-value specifications for tagged protocols

Summary

Allow tag values to be specified for easier FFI interaction.

Owner

Fred Barnes <F.R.M.Barnes@kent.ac.uk>

Status

Accepted

Date-Accepted

2004-12-21

Keywords

language protocols ffi

This addition allows the programmer to specify specific values for the tags in tagged (variant) protocols. This allows external C code (using the CIF framework) to communicate on variant protocol channels with occam processes, without relying on (occam-pi) compiler-generated constants. Tag values are specified in a natural way, for example:

PROTOCOL EXTERNAL.LINK
  CASE
    mouse.x.y = 0; INT; INT
    mouse.down = 2; INT
    mouse.up = 3; INT
:

The compiler will check that specified tag-values do not conflict when dealing with nested protocols and/or inherited protocols. Additionally the compiler will disallow any tagged protocol with a mixture of value-specified and non-value-specified tags.

OEP/125 (last edited 2007-09-27 00:39:34 by ats1)