OEP

108

Title

Nested PROTOCOL definitions

Summary

Protocol definitions may use other protocols as elements.

Owner

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

Status

Accepted

Date-Accepted

2001-12-12

Keywords

language protocols

Nested PROTOCOLs allow one PROTOCOL definition to be used within another. For example:

PROTOCOL simple IS INT:
PROTOCOL seq.proto IS INT; INT; simple:
PROTOCOL seq.other IS BYTE; seq.proto; INT::[]BYTE
PROTOCOL similar IS seq.other:

In the above, "seq.other" has the structure "BYTE; INT; INT; INT; INT::[]BYTE". It should be noted that "similar" and "seq.other" are still distinct PROTOCOLs.

Tagged protocols can also be used, for example:

PROTOCOL tagged
  CASE
    empty
    int; INT
    data; BYTE; similar; INT16
:

PROTOCOL more.tags
  CASE
    FROM tagged
    flibble; seq.proto
:

OEP/108 (last edited 2007-09-27 00:09:46 by ats1)