(315,040) (000,030)procedure-declaration (000,010)(1,0)020070procedure-head (1,0)020070procedure-body (1,0)020070procedure-tail (1,0)020
(315,110) (000,100)procedure-head (000,080)(1,0)030060type-declarer (1,0)030040PROC (1,0)005 (005,070)(20,20)[rt] (025,070)(20,20)[lb] (025,060)(1,0)70 (095,070)(20,20)[rb] (115,070)(20,20)[lt] (165,070)(20,20)[rt] (175,070)(0,-1)020 (165,050)(20,20)[rb] (165,040)(-1,0)140 (025,030)(20,20)[l] (025,020)(1,0)005070procedure-name (1,0)030100formal-parameters-pack (1,0)030010: (1,0)030 (105,010)(20,20)[rt] (125,010)(20,20)[lb] (125,000)(1,0)110 (235,010)(20,20)[rb] (255,010)(20,20)[lt]
The head gives the procedure-name, the types and access attributes of its parameters (if any) and the type of its result (if any).
(315,160) (000,150)formal-parameters-pack (000,130)(1,0)030010( (1,0)005 (045,120)(20,20)[r] (235,100)(20,20)[r] (235,110)(-1,0)040 (025,110)(1,0)160010, (145,100)(20,20)[l] (025,100)(20,20)[l] (025,090)(1,0)005060type-declarer (1,0)060080parameter-name (1,0)030010) (1,0)030 (015,100)(0,-1)080 (025,020)(20,20)[lb] (025,010)(1,0)030 (095,080)(20,20)[r] (095,070)(-1,0)040 (055,060)(20,20)[l] (045,060)(0,-1)040 (125,080)(20,20)[lt] (115,080)(0,-1)060 (055,060)(20,20)[lb] (055,050)(1,0)005040CONST (1,0)005 (105,060)(20,20)[rb] (055,040)(20,20)[lb] (055,030)(1,0)005040VAR (1,0)005 (105,040)(20,20)[rb] (055,020)(20,20)[lb] (055,010)(1,0)005040PROC (1,0)005 (105,020)(20,20)[rb] (105,010)(1,0)025100virtual-parameters-pack (1,0)005 (235,020)(20,20)[r] (235,030)(-1,0)110 (125,040)(20,20)[lb]
Parameters are either objects or procedures, as can be deduced from this rather unwieldy syntax diagram. In case a procedure is to be passed as a parameter, the types of its parameters are in their turn to be specified precisely by means of a virtual-parameters-pack.
(315,160) (000,150)virtual-parameters-pack (000,130)(1,0)030010( (1,0)005 (045,120)(20,20)[r] (235,100)(20,20)[r] (235,110)(-1,0)040 (025,110)(1,0)160010, (025,100)(20,20)[l] (025,090)(1,0)005060type-declarer (1,0)170010) (1,0)030 (015,100)(0,-1)080 (025,020)(20,20)[lb] (025,010)(1,0)030 (095,080)(20,20)[r] (095,070)(-1,0)040 (055,060)(20,20)[l] (045,060)(0,-1)040 (125,080)(20,20)[lt] (115,080)(0,-1)060 (055,060)(20,20)[lb] (055,050)(1,0)005040CONST (1,0)005 (105,060)(20,20)[rb] (055,040)(20,20)[lb] (055,030)(1,0)005040VAR (1,0)005 (105,040)(20,20)[rb] (055,020)(20,20)[lb] (055,010)(1,0)005040PROC (1,0)005 (105,020)(20,20)[rb] (105,010)(1,0)025100virtual-parameters-pack (1,0)005 (235,020)(20,20)[r] (235,030)(-1,0)110 (125,040)(20,20)[lb]
A procedure-body has the same form as a main-packet without a bottom-up-part.
(315,040) (000,030)procedure-body (000,010)(1,0)030040root (1,0)030080top-down-part (1,0)030
(315,050) (000,040)procedure-tail (000,020)(1,0)030040ENDPROC (1,0)030080procedure-name (1,0)030 (075,010)(20,20)[rt] (095,010)(20,20)[lb] (095,000)(1,0)90 (185,010)(20,20)[rb] (205,010)(20,20)[lt]
The name of the procedure is repeated after the ENDPROC symbol. In the Elan Programming Environment this name may be left out (in which case it is inserted automatically).