Declare clause | CPN Tools help |
For generating some colour set functions in some versions of CPN Tools | CPN ML |
declare
clause to generate some of the colour set functions. The declare
clause can be appended to declarations for enumerated colour sets, product colour sets, record colour sets, and union colour sets.
Many of the versions between 0.1.1 and 0.1.53 are available only as internal releases. The declare
clause does NOT need to be used in versions 0.1.54 and above, unless:
colset name = ... declare id1, id2, ..., idn ;
where for i=1..n, idi
is one of the following: input, all, ran, size, ord, col, of,
or mult
. For more details about these functions, read more about colour set functions.
The declare
clause must be used to declare the following functions:
input
input, all, ran, size, ord, col, mult
.
input, all, ran, size, ord, col, of_idi
set_idi
functions for product and record colour sets are not available in versions before 0.1.54.
colset P = product SmallInt * Bool declare mult, all;
This declaration ensures that the functions P.mult
and P.all
are available.
colset R = record i:INT * s:STRING declare set;
This declaration ensures that the functions R.set_i
and R.set_s
are available.
colset Packet = union DATA: Data + ACK declare of,size;
This declaration ensures that the functions Packet.of_DATA
, Packet.of_ACK
, and Packet.size
are available.