Next: The return statement
Up: Blocks and statements
Previous: The break statement
The continue statement[21]
:
ATTR CannotContinue: int;
CLASS SYMBOL Continuable COMPUTE SYNT.CannotContinue=0; END;
CLASS SYMBOL Uncontinuable COMPUTE
SYNT.CannotContinue=1;
SYNT.GotNotLoop=1;
END;
TREE SYMBOL LoopStatement INHERITS Continuable END;
TREE SYMBOL Goal INHERITS Uncontinuable END;
TREE SYMBOL MethodBody INHERITS Uncontinuable END;
TREE SYMBOL MethodBody INHERITS Uncontinuable END;
TREE SYMBOL ClassInitializer INHERITS Uncontinuable END;
ATTR NotLoop: int;
TREE SYMBOL Statement COMPUTE SYNT.NotLoop=1; END;
RULE: Statement ::= LoopStatement COMPUTE Statement.NotLoop=0; END;
RULE: LabeledStatement ::= LabelIdDef ':' Statement COMPUTE
LabeledStatement.GotNotLoop=
ResetNotLoop(LabelIdDef.LblKey,Statement.NotLoop)
<- INCLUDING (LabeledStatement.GotNotLoop,Uncontinuable.GotNotLoop);
END;
RULE: Statement ::= 'continue' ';' COMPUTE
IF(INCLUDING (Continuable.CannotContinue,Uncontinuable.CannotContinue),
message(ERROR,"Continue must occur in a loop or switch",0,COORDREF));
END;
RULE: Statement ::= 'continue' LabelIdUse ';' COMPUTE
IF(INCLUDING (Continuable.CannotContinue,Uncontinuable.CannotContinue),
message(ERROR,"No non-local jumps",0,COORDREF));
IF(GetNotLoop(LabelIdUse.LblKey,1),
message(
ERROR,
CatStrInd("Must label a loop: ",LabelIdUse.Sym),
0,
COORDREF))
<- INCLUDING (LabeledStatement.GotNotLoop,Uncontinuable.GotNotLoop);
END;
This macro is invoked in definition 14.
Property definitions[22]
:
NotLoop: int;
This macro is defined in definitions 10, 16, 22, 36, and 40.
This macro is invoked in definition 3.
Next: The return statement
Up: Blocks and statements
Previous: The break statement
2008-09-11