private Status executeWhile ( Stmt . While stmt , CallStack frame , EnclosingScope scope ) { Status r ; do { RValue . Bool operand = executeExpression ( BOOL_T , stmt . getCondition ( ) , frame ) ; if ( operand == RValue . False ) { return Status . NEXT ; } // Keep executing the loop body until we exit it somehow. r = executeBlock ( stmt . getBody ( ) , frame , scope ) ; } while ( r == Status . NEXT || r == Status . CONTINUE ) ; // If we get here, then we have exited the loop body without falling // through to the next bytecode. if ( r == Status . BREAK ) { return Status . NEXT ; } else { return r ; } }
Execute a While statement at a given point in the function or method body . This will loop over the body zero or more times .