@brief Looks for the next state-pop sequence (close/end) for the current state

@returns Data in the same format as get_next: a tuple of (next, matches).
If no match is found, next is -1 and matches is null
323035
public function nextEndData()
    {
        $stateData = $this->state();
        if ($stateData === null) {
            return array(-1, null); // init/root state
        }
        $termPattern = $stateData[2];
        assert($termPattern !== null);
        $data = $this->getNext(array($termPattern));
        return $data;
    }
823405
def next(self):
        
        while True:
            if self._source == 'CouchDB':
                raise CloudantFeedException(101)
            if self._last_seq:
                self._options.update({'since': self._last_seq})
                self._resp = None
                self._last_seq = None
            if not self._resp:
                self._start()
            if self._stop:
                raise StopIteration
            skip, data = self._process_data(next_(self._lines))
            if not skip:
                break
        return data
1019656
public String lookupNextToken() {
        skipWhitespace();
        int start = index;
        for (int end = index; end < originalInput.length(); end++) {
            if (Character.isWhitespace(originalInput.charAt(end))) {
                if (end > start) {
                    return originalInput.subSequence(start, end).toString();
                }
                return null;
            }
        }
        if (start < originalInput.length()) {
            return originalInput.subSequence(start, originalInput.length())
                    .toString();
        }
        return null;
    }
265342
def next(self, match, predicate=None, index=None):
        
        current = match.start + 1
        while current <= self._max_end:
            next_matches = self.starting(current)
            if next_matches:
                return filter_index(next_matches, predicate, index)
            current += 1
        return filter_index(_BaseMatches._base(), predicate, index)
172191
def next(self):
        """"""
        if self.__empty:
            raise StopIteration
        if len(self.__data) or self._refresh():
            if self.__manipulate:
                _db = self.__collection.database
                return _db._fix_outgoing(self.__data.popleft(),
                                         self.__collection)
            else:
                return self.__data.popleft()
        else:
            raise StopIteration
848465
public EndState getEndState() {
        EndState result = EndState.PASSED;
        for ( ScenarioToken s : scenarios) {
            if ( s.getEndState() == EndState.FAILED) {
                result = EndState.FAILED;
                break;
            }
        }

        if ( result != EndState.FAILED) {
            for ( ScenarioToken s : scenarios) {
                if ( s.getEndState() == EndState.PENDING) {
                    result = EndState.PENDING;
                }
            }
        }
        return result;
    }
200522
public String next() {
        if (done) return null;

        // construct return value

        buffer.setLength(0); // delete old contents
        for (int i = 0; i < pieces.length; ++i) {
            buffer.append(pieces[i][current[i]]);
        }
        String result = buffer.toString();

        // find next value for next time

        for (int i = current.length - 1; ; --i) {
            if (i < 0) {
                done = true;
                break;
            }
            current[i]++;
            if (current[i] < pieces[i].length) break; // got sequence
            current[i] = 0;
        }
        return result;
    }
404300
@Nullable
    String next() {
        if( lastIdx >= selector.length() ) {
            return null;
        }
        LOOP: do {
            if( ++idx == selector.length() ) {
                break LOOP;
            }
            switch( selector.charAt( idx ) ) {
                case '.':
                case '#':
                case ':':
                case '[':
                    break LOOP;
            }
        } while( true );
        String str = selector.substring( lastIdx, idx ).trim();
        lastIdx = idx;
        return str;
    }
1373766
@Override
  public String getNext() {
    try {
      int a;
      while ((a = lexer.yylex()) == CHTBLexer.IGNORE) {
        //System.err.println("#ignored: " + lexer.match());
      }
      if (a == CHTBLexer.YYEOF) {
        return null;
      } else {
        //System.err.println("#matched: " + lexer.match());
        return lexer.match();
      }
    } catch (IOException ioe) {
      // do nothing, return null
    }
    return null;
  }
596295
private int nextBoundaryAfter(int startIndex) {
        BreakIterator breakiterator = search_.breakIter();

        if (breakiterator == null) {
            breakiterator = search_.internalBreakIter_;
        }

        if (breakiterator != null) {
            return breakiterator.following(startIndex);
        }

        return startIndex;
    }
778499
def get_next(object_list)
      varbind_list = @mib.varbind_list(object_list, :NullValue)
      request = GetNextRequest.new(@@request_id.next, varbind_list)
      try_request(request)
    end
717174
def next(self):
        
        if self._current < len(self._record_list):
            rec = self._record_list[self._current]
            key = rec['name']
            self._current += 1
            return key
        else:
            raise StopIteration
262275
def complete_next(self, count=1, disable_wrap_around=False):
        
        if self.complete_state:
            completions_count = len(self.complete_state.current_completions)

            if self.complete_state.complete_index is None:
                index = 0
            elif self.complete_state.complete_index == completions_count - 1:
                index = None

                if disable_wrap_around:
                    return
            else:
                index = min(completions_count-1, self.complete_state.complete_index + count)
            self.go_to_completion(index)
1251398
def next(self):
        
        if self.col < self.data.num_attributes:
            index = self.col
            self.col += 1
            return self.data.attribute(index)
        else:
            raise StopIteration()
456408
public String getNextString()
    {
        Object data = this.getNextData();
        if (data instanceof String)
            return (String)data;
        return null;    // EOF
    }
1307948
def next_match(ary,start)
      if @firstresult
        @firstresult,result=nil,@firstresult
        assert ::Array===result.first.first
        return result
      end

   
      result,di,ri=@progress.last_next_match
      result or return @progress=nil      
      if result and ri==@reg.max_matches
        result=[@progress.clean_result,di]
        assert ::Array===result.first.first
        return result
      end
      

      (@progress and !@progress.matchset_stack.empty?) or return @progress=nil
      assert @progress.regsidx
      @progress.backtrack or return @progress=nil

      #need to adjust ri?

      #is this right... dunno...
      result,di,bogus=@progress.bt_match


      if result
        result=[@progress.clean_result,di]
        assert ::Array===result.first.first
        return result
      end
    end
1297610
public A next() {
        A x = elems.head;
        if (!elems.isEmpty()) {
            elems = elems.tail;
            if (elems.isEmpty()) last = null;
            count--;
        }
        return x;
    }