Previous

4.6. Declarers

{Declarers specify modes. A declarer is either a declarator, which explicitly constructs a mode, or an applied-mode-indication, which stands for some declarator by way of a mode-declaration. Declarators are built from VOID, INT, REAL, BOOL and CHAR {10.2.2 }, with the assistance of other symbols such as REF, STRUCT, [ ], PROC, and UNION. For example, PROC(REAL)BOOL specifies the mode 'procedure with real parameter yielding boolean'.

Actual-declarers, used typically in generators, require the presence of bounds. Formal-declarers, used typically in formal-parameters and casts, are without bounds. The declarer following a ref is always 'virtual'; it may then specify a 'flexible ROWS of MODE', because flexibility is a property of names. Since actual-declarers follow an implicit 'reference to' in generators, they may also specify 'flexible ROWS of MODE'.}

4.6.1. Syntax

A) VICTAL :: VIRACT ; formal.

B) VIRACT :: virtual ; actual.

C) MOIDS :: MOID ; MOIDS MOID.

a) VIRACT MOID NEST declarer{c,e,g,h,523a,b } : VIRACT MOID NEST declarator{c,d,g,h,o,s,-}; MOID TALLY NEST applied mode indication with TAB{48b ,-}.

b) formal MOID NEST declarer{e,h,p,r,u,34k ,44a,541a,b,e,551a} : where MOID deflexes to MOID{47a,b,c ,-}, formal MOID NEST declarator{c,d,h,o,s,-}; MOID1 TALLY NEST applied mode indication with TAB{48b ,-}, where MOID1 deflexes to MOID{47a,b,c ,-}.

c) VICTAL reference to MODE NEST declarator{a,b,42c } : reference to{94d } token, virtual MODE NEST declarer{a}.

d) VICTAL structured with FIELDS mode NEST declarator{a,b,42c } : structure{94d } token, VICTAL FIELDS NEST portrayer of FIELDS{e} brief pack.

e) VICTAL FIELDS NEST portrayer of FIELDS1{d,e} : VICTAL MODE NEST declarer{a,b}, NEST MODE FIELDS joined definition of FIELDS1{41b,c } ; where (FIELDS1) is (FIELDS2 FIELDS3), VICTAL MODE NEST declarer{a,b}, NEST MODE FIELDS joined definition of FIELDS2{41b,c } , and also{94f } token, VICTAL FIELDS NEST portrayer of FIELDS3{e}.

f) NEST MODE FIELDS definition of MODE field TAG{41c } : MODE field FIELDS defining field selector with TAG{48c } .

g) VIRACT flexible ROWS of MODE NEST declarator{a,42c } : flexible{94d } token, VIRACT ROWS of MODE NEST declarer{a}.

h) VICTAL ROWS of MODE NEST declarator{a,b,42c } : VICTAL ROWS NEST rower{i,j,k,l} STYLE bracket, VICTAL MODE NEST declarer{a,b}.

i) VICTAL row ROWS NEST rower{h,i} : VICTAL row NEST rower{j,k,l}, and also{94f } token, VICTAL ROWS NEST rower{i,j,k,l}.

j) actual row NEST rower{h,i} : NEST lower bound{m}, up to{94f } token, NEST upper bound{n}; NEST upper bound{n}.

k) virtual row NEST rower{h,i} : up to{94f } token option.

l) formal row NEST rower{h,i} : up to{94f } token option.

m) NEST lower bound{j,532f,g } : meek integral NEST unit{32d } .

n) NEST upper bound{j,532f } : meek integral NEST unit{32d } .

o) VICTAL PROCEDURE NEST declarator{a,b,42c } : procedure{94d } token, formal PROCEDURE NEST plan{p}.

p) formal procedure PARAMETY yielding MOID NEST plan{o,45a } : where (PARAMETY) is (EMPTY), formal MOID NEST declarer{b}; where (PARAMETY) is (with PARAMETERS), PARAMETERS NEST joined declarer{q,r} brief pack, formal MOID NEST declarer{b}.

q) PARAMETERS PARAMETER NEST joined declarer{p,q} : PARAMETERS NEST joined declarer{q,r}, and also{94f } token, PARAMETER NEST joined declarer{r}.

r) MODE parameter NEST joined declarer{p,q} : formal MODE NEST declarer{b}.

s) VICTAL union of MOODS1 MOOD1 mode NEST declarator{a,b,42c } : unless EMPTY with MOODS1 MOOD1 incestuous{47f } , union of{94d } token, MOIDS NEST joined declarer{t,u} brief pack, where MOIDS ravels to MOODS2{47g } and safe MOODS1 MOOD1 subset of safe MOODS2{73l } and safe MOODS2 subset of safe MOODS1 MOOD1{73l,m } .

t) MOIDS MOID NEST joined declarer{s,t} : MOIDS NEST joined declarer{t,u}, and also{94f } token, MOID NEST joined declarer{u}.

u) MOID NEST joined declarer{s,t} : formal MOID NEST declarer{b}. {Examples:

}

a)
[1 : n] REAL ·PERSON
b)
[ ] REAL ·STRING
c)
REF REAL
d)
STRUCT(INT age, REF PERSON father, son)
e)
REF PERSON father, son ·INT age, REF PERSON father, son
f)
age
g)
FLEX [1 : n] REAL
h)
[1 : m,1 : n] REAL
i)
1 : m, 1 : n
j)
1 : n
k)
:
l)
:
m)
1
n)
n
o)
PROC(BOOL, BOOL)BOOL
p)
(BOOL, BOOL)BOOL
q)
BOOL, BOOL
r)
BOOL
s)
UNION(INT, CHAR)
t)
INT, CHAR
u)
INT
{For actual-MOID-TALLY-declarers, see 4.2.1.c ; for actual-routine-declarers, see 4.4.1.b .

There are no declarers specifying modes such as 'union of integral union of integral real mode mode' or 'union of integral real integral mode'. The declarers UNION(INT, UNION(INT, REAL)) and UNION(INT, REAL, INT) may indeed be written, but in both cases the mode specified is 'union of integral real mode' (which can as well be spelled 'union of real integral mode').}

4.6.2. Semantics

a) The yield W of an actual-MODE-declarer D, in an environ E, is determined as follows:
If 'MODE' is some 'STOWED',
then
otherwise,

b) The yield W of an actual-STOWED-declarator D is determined as follows:

Case A: 'STOWED' is some 'structured with FIELDS mode':


· the constituent declarers of D are elaborated collaterally;

· each field of W is a variant {4.4.2.c }

( 1) of the yield of the last constituent MODE-declarer of D occurring before the constituent defining-field-selector of D selecting {2.1.5.g } that field,
( 2) for that 'MODE';

Case B: 'STOWED' is some 'ROWS of MODE':


· all the constituent lower-bounds and upper-bounds of D and the declarer D1 of D are elaborated collaterally; For i = 1... n, where n is the number of 'row's contained in 'ROWS',

· let li be the yield of the lower-bound, if any, of the i-th constituent row-rower of D, and be 1 otherwise;

· let ui be the yield of the upper-bound of that row-rower;

· W is composed of

( 1) a descriptor ((l1,u1), ..., (ln,un)),
( 2) variants of the yield of D1, for 'MODE';

Case C: 'STOWED' is some 'flexible ROWS of MODE':


· W is the yield of the declarer of D.

c) The scene S "developed from" an actual-STOWED-declarer D in an environ E is determined as follows:

If the visible direct descendent D1 of D is a mode-indication,
then


· S is the scene developed from that yielded by D1 in E;

otherwise{D1 is a declarator} ,


· S is composed of D1 and E.

d) A given MOID-declarer "specifies" the mode 'MOID'.
 
Next