LKLoop documentation
LKLoop : LKASTOverview
AST node representing a loop construct.
The loop may have pre- and post-conditions that will terminate the loop when evaluated to false, or one might rely on LKReturn or LKBreak to end the loop.
It is possible to set a list of statements that will be executed after each iteration, typically to increment a counter or similar. Initialization may be done from a statement list in this node as well.
Each LKLoop may be labelled to make it possible to break or continue outer loops when there are nested flows of control.
Default
- + (id) loopWithStatements: (NSMutableArray *)statementList
Return a new loop with the specified statements.
- - (id) initWithStatements: (NSMutableArray *)statementList
Initialise a new loop with the specified statements.
- - (void) setUpdateStatements: (NSMutableArray *)anArray
Set the statements executed after each iteration of the loop.
- - (NSMutableArray *) updateStatements
Return the list of statements executed after each iteration of the loop.
- - (void) setPreCondition: (LKAST *)condition
Set expression tested for truth before each loop iteration.
- - (LKAST *) preCondition
Return expression tested for truth before each loop iteration.
- - (void) setPostCondition: (LKAST *)condition
Set expression tested for truth after each loop iteration.
- - (LKAST *) postCondition
Return expression tested for truth after each loop iteration.