Skip to main content

Flow and Control

controlst = gost / subst / loopstr / casest;

GO TO Statements​

gost = "GO" "TO" (labelv / .id);
assignlabel = "ASSIGN" .id "TO" labelv;

Subroutines​

subst = callst / returnst / cortnout;
callst = "CALL" procname (exp / .emptyu);
returnst = "RETURN" (exp / .empty);
cortnout = "STUFF" exp "IN" pipename;
cortnin = "FETCH" pipename;
  • FETCH is a builtin function whose value is computed by envoking the named co-routine.

Loop Statements​

Syntax​

loopst = whilest / untilst / forst;
whilest = "WHILE" conjunct "DO" statement;
untilst = "UNTIL" conjunct "DO" statement;
forst = "FOR" integerv '- exp ("BY" exp / .empty) "TO" exp
"DO" statements;
  • The value of while and until statements is defined to be false and true (or 0 and non-zero) respectively.

  • For statements evaluate their initial exp, by part, and to part once, at initialization time. The running index of for statements is not available for change within the loop, it may only be read. If, some compilers can take advantage of this (say put it in a register) all the better. The increment and the to bound will both be rounded to integers during the initialization.