Resumes scanning until the next regular expression is matched,
the end of input is encountered or an I/O-Error occurs.

@return      the next token
@exception   java.io.IOException  if any I/O-Error occurs
19545
@Override
public java_cup.runtime.Symbol next_token() throws java.io.IOException {
    int zzInput;
    int zzAction;

    // cached fields:
    int zzCurrentPosL;
    int zzMarkedPosL;
    int zzEndReadL = zzEndRead;
    char [] zzBufferL = zzBuffer;
    char [] zzCMapL = ZZ_CMAP;

    int [] zzTransL = ZZ_TRANS;
    int [] zzRowMapL = ZZ_ROWMAP;
    int [] zzAttrL = ZZ_ATTRIBUTE;

    while (true) {
      zzMarkedPosL = zzMarkedPos;

      yychar+= zzMarkedPosL-zzStartRead;

      boolean zzR = false;
      int zzCh;
      int zzCharCount;
      for (zzCurrentPosL = zzStartRead  ;
           zzCurrentPosL < zzMarkedPosL ;
           zzCurrentPosL += zzCharCount ) {
        zzCh = Character.codePointAt(zzBufferL, zzCurrentPosL, zzMarkedPosL);
        zzCharCount = Character.charCount(zzCh);
        switch (zzCh) {
        case '\u000B':
        case '\u000C':
        case '\u0085':
        case '\u2028':
        case '\u2029':
          yyline++;
          yycolumn = 0;
          zzR = false;
          break;
        case '\r':
          yyline++;
          yycolumn = 0;
          zzR = true;
          break;
        case '\n':
          if (zzR)
            zzR = false;
          else {
            yyline++;
            yycolumn = 0;
          }
          break;
        default:
          zzR = false;
          yycolumn += zzCharCount;
        }
      }

      if (zzR) {
        // peek one character ahead if it is \n (if we have counted one line too much)
        boolean zzPeek;
        if (zzMarkedPosL < zzEndReadL)
          zzPeek = zzBufferL[zzMarkedPosL] == '\n';
        else if (zzAtEOF)
          zzPeek = false;
        else {
          boolean eof = zzRefill();
          zzEndReadL = zzEndRead;
          zzMarkedPosL = zzMarkedPos;
          zzBufferL = zzBuffer;
          if (eof)
            zzPeek = false;
          else
            zzPeek = zzBufferL[zzMarkedPosL] == '\n';
        }
        if (zzPeek) yyline--;
      }
      zzAction = -1;

      zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;

      zzState = ZZ_LEXSTATE[zzLexicalState];

      // set up zzAction for empty match case:
      int zzAttributes = zzAttrL[zzState];
      if ( (zzAttributes & 1) == 1 ) {
        zzAction = zzState;
      }


      zzForAction: {
        while (true) {

          if (zzCurrentPosL < zzEndReadL) {
            zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
            zzCurrentPosL += Character.charCount(zzInput);
          }
          else if (zzAtEOF) {
            zzInput = YYEOF;
            break zzForAction;
          }
          else {
            // store back cached positions
            zzCurrentPos  = zzCurrentPosL;
            zzMarkedPos   = zzMarkedPosL;
            boolean eof = zzRefill();
            // get translated positions and possibly new buffer
            zzCurrentPosL  = zzCurrentPos;
            zzMarkedPosL   = zzMarkedPos;
            zzBufferL      = zzBuffer;
            zzEndReadL     = zzEndRead;
            if (eof) {
              zzInput = YYEOF;
              break zzForAction;
            }
            else {
              zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL, zzEndReadL);
              zzCurrentPosL += Character.charCount(zzInput);
            }
          }
          int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
          if (zzNext == -1) break zzForAction;
          zzState = zzNext;

          zzAttributes = zzAttrL[zzState];
          if ( (zzAttributes & 1) == 1 ) {
            zzAction = zzState;
            zzMarkedPosL = zzCurrentPosL;
            if ( (zzAttributes & 8) == 8 ) break zzForAction;
          }

        }
      }

      // store back cached position
      zzMarkedPos = zzMarkedPosL;

      if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
        zzAtEOF = true;
            zzDoEOF();
          {     return new java_cup.runtime.ComplexSymbolFactory.ComplexSymbol("", Symbols.EOF);
 }
      }
      else {
        switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
          case 1:
            { return symbol(Symbols.CONSTANT, yytext());
            }
          case 11: break;
          case 2:
            { if (includeCommentsAndWhitespace) {return symbol(Symbols2.WHITESPACE, yytext());}
            }
          case 12: break;
          case 3:
            { return symbol(Symbols.PCLOSE);
            }
          case 13: break;
          case 4:
            { if (includeCommentsAndWhitespace) {return symbol(Symbols2.COMMENT, yytext());}
            }
          case 14: break;
          case 5:
            { return symbol(Symbols.POPEN);
            }
          case 15: break;
          case 6:
            { return symbol(Symbols.VARIABLE, yytext());
            }
          case 16: break;
          case 7:
            { return symbol(Symbols.IMPLIES);
            }
          case 17: break;
          case 8:
            { return symbol(Symbols.OR);
            }
          case 18: break;
          case 9:
            { return symbol(Symbols.NOT);
            }
          case 19: break;
          case 10:
            { return symbol(Symbols.DISTINCT);
            }
          case 20: break;
          default:
            zzScanError(ZZ_NO_MATCH);
        }
      }
    }
  }
65994
private String getNextLine(BufferedReader reader) throws Exception {
        String line = reader.readLine();
        if (line != null) {
            return line;
        } else {
            throw new Exception("Error parsing server status file (unexpectedly ended): "
                    + _file.getPath());
        }
    }
1298913
@Override
  public int nextStartPosition() throws IOException {
    if (findMatches()) {
      currentMatch = queueMatches.get(0);
      queueMatches.remove(0);
      noMorePositions = false;
      return currentMatch.startPosition();
    } else {
      currentMatch = null;
      noMorePositions = true;
      return NO_MORE_POSITIONS;
    }
  }
199516
public final int next() throws IOException {
        if (m_nextException!=null) {
            throw m_nextException;
        }
        try {
            return doNext();
        }
        catch (IOException e) {
            m_nextException=e;
            resetState();
            throw e;
        }
    }
591642
@Override
    public Token next() {
        if (!hasNext())
            throw new NoSuchElementException();
        Token t = this.tok;
        this.tok = null;
        return t;
    }
289351
public Token next() throws IOException {

        // skip whitespace
        while (Character.isWhitespace((char)lastChar))
        {
            readChar();
        }

        // handle punctuation
        switch (lastChar)
        {
            case -1:  readChar(); return Token.TokenEOF;
            case '{': readChar(); return Token.TokenBraceL;
            case '}': readChar(); return Token.TokenBraceR;
            case '[': readChar(); return Token.TokenBrackL;
            case ']': readChar(); return Token.TokenBrackR;
            case ':': readChar(); return Token.TokenColon;
            case ',': readChar(); return Token.TokenComma;

            case '"':
            case '\'':
                String stringValue = readString();
                return new Token(stringValue);

            case '-':
            case '.':
            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
                Number numberValue = readNumber();
                return new Token(numberValue);

            case 'n': 
            case 't':
            case 'f':
                String ident = readIdentifier();

                if (ident.equals("null"))  return Token.TokenNull;
                if (ident.equals("true"))  return Token.TokenTrue;
                if (ident.equals("false")) return Token.TokenFalse;

                throw new IOException("Unexpected identifier '" + ident + "' " + onLineCol());

            default:
                throw new IOException("Unexpected character '" + (char)lastChar + "' " + onLineCol());

        }

    }
583321
public boolean next() throws IOException {
		boolean hasNext = true;
		try {
			oldId = stream.readInt();
			oldText = stream.readUTFAsArray();
		} catch (EOFException e) {
			hasNext = false;
		}
		return hasNext;
	}
236555
@Nonnull
    protected Token nextSymbol() throws IOException {
        lastChar = 0;
        return new Token(buffer, bufferOffset, 1, lineNo, linePos);
    }
170424
@Override
    public String nextToken()
        throws NoSuchElementException
    {
        if (!hasMoreTokens() || _token==null)
            throw new NoSuchElementException();
        String t=_token.toString();
        _token.setLength(0);
        _hasToken=false;
        return t;
    }
655334
public final String getNextLine() throws IOException {
    String str = null;
    if (buf_end - buf_pos <= 0) {
      if (fillBuffer() < 0) {
        return null;
      }
    }
    int lineend = -1;
    for (int i = buf_pos; i < buf_end; i++) {
      if (buffer[i] == '\n') {
        lineend = i;
        break;
      }
      // check for only '\r' as line end
      if ((i - buf_pos > 0) && buffer[i - 1] == '\r') {
        lineend = i - 1;
        break;
      }
    }
    if (lineend < 0) {
      StringBuilder input = new StringBuilder(256);
      int c;
      int lastC = 0;
      while (((c = read()) != -1) && (c != '\n') && (lastC != '\r')) {
        input.append((char) c);
        lastC = c;
      }
      if ((c == -1) && (input.length() == 0)) {
        return null;
      }
      return input.toString();
    }
    if (lineend > 0 && buffer[lineend] == '\n' && buffer[lineend - 1] == '\r') {
      str = new String(buffer, buf_pos, lineend - buf_pos - 1);
    } else {
      str = new String(buffer, buf_pos, lineend - buf_pos);
    }
    buf_pos = lineend + 1;
    return str;
  }
1144058
public function nextToken()
    {
        if ($this->_input === null) {
            return null;
        }

        do {
            if (! preg_match('/[\p{L}\p{N}]+/u', $this->_input, $match, PREG_OFFSET_CAPTURE, $this->_bytePosition)) {
                // It covers both cases a) there are no matches (preg_match(...) === 0)
                // b) error occured (preg_match(...) === FALSE)
                return null;
            }

            // matched string
            $matchedWord = $match[0][0];

            // binary position of the matched word in the input stream
            $binStartPos = $match[0][1];

            // character position of the matched word in the input stream
            $startPos = $this->_position +
                        iconv_strlen(
                            substr(
                                $this->_input,
                                $this->_bytePosition,
                                $binStartPos - $this->_bytePosition
                            ),
                            'UTF-8'
                        );
            // character postion of the end of matched word in the input stream
            $endPos = $startPos + iconv_strlen($matchedWord, 'UTF-8');

            $this->_bytePosition = $binStartPos + strlen($matchedWord);
            $this->_position     = $endPos;

            $token = $this->normalize(new Zend_Search_Lucene_Analysis_Token($matchedWord, $startPos, $endPos));
        } while ($token === null); // try again if token is skipped

        return $token;
    }
877535
private boolean readNextLine() throws IOException {
        boolean newLine = false;
        if (bufferLimit > 0 && !bufferLineEnd) {
            // check for "last line"
            if (bufferLimit < buffer.length) {
                return false;
            }
        } else {
            newLine = true;
        }

        bufferLineEnd = false;

        int off = 0;
        char[] b = new char[1];
        while (off < buffer.length && reader.read(b, 0, 1) > 0) {
            final char ch = b[0];
            buffer[off] = ch;
            ++off;
            if (ch == '\n') {
                bufferLineEnd = true;
                break;
            }
        }
        if (off > 0) {
            if (newLine) {
                ++lineNo;
                linePos = 0;
            }
            if (off < buffer.length) {
                buffer[off] = 0;
            }
            bufferOffset = -1;
            bufferLimit = off;
            return true;
        }
        return false;
    }
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;
  }
1102033
public long next() {
        try {
            ByteBufferUtil.readWithShortLength(input);

            final long offset = input.readLong();

            // TODO: Because this is version ic > ia promotedIndex is true and we need to handle it. See C* Descriptor
            skipPromotedIndex(input);

            return offset;
        } catch (IOException e) {
            throw new IOError(e);
        }
    }
423553
public Token scanIndent() {
		int start = pos;
		while (pos < input.length()
				&& (input.charAt(pos) == ' ' || input.charAt(pos) == '\t')) {
			pos++;
		}
		return new Token(Token.Kind.Indent, input.substring(start, pos), start);
	}
128303
public FileStatus next() throws IOException {
    if (finished) {
      LOG.warn("Should not call next() after FINISH_TOKEN is obtained.");
      return FINISH_TOKEN;
    }
    FileStatus f = null;
    try {
      f = output.take();
    } catch (InterruptedException e) {
      finished = true;
      interruptProcessors();
      throw new IOException(e);
    }
    if (f == FINISH_TOKEN) {
      LOG.info("traversal is done. Returning FINISH_TOKEN");
      finished = true;
    }
    return f;
  }
1095486
public boolean hasNextToken() {
    if (this.nextToken == null) {
      try {
        this.nextToken = this.jlexer.yylex();
      } catch (final IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
    return this.nextToken != null;
  }