public Token nextToken() {if (i >= tokens.size()) {if (eofToken == null) {int start = -1;if (tokens.size() > 0) {int previousStop = tokens.get(tokens.size() - 1).getStopIndex();if (previousStop != -1) {start = previousStop + 1;}}int stop = Math.max(-1, start - 1);eofToken = _factory.create(new Pair<TokenSource, CharStream>(this, getInputStream()), Token.EOF, "EOF", Token.DEFAULT_CHANNEL, start, stop, getLine(), getCharPositionInLine());}return eofToken;}Token t = tokens.get(i);if (i == tokens.size() - 1 && t.getType() == Token.EOF) {eofToken = t;}i++;return t;}

public virtual IToken NextToken(){if (i >= tokens.Count){if (eofToken == null){int start = -1;if (tokens.Count > 0){int previousStop = tokens[tokens.Count - 1].StopIndex;if (previousStop != -1){start = previousStop + 1;}}int stop = Math.Max(-1, start - 1);eofToken = _factory.Create(Tuple.Create((ITokenSource)this, InputStream), TokenConstants.EOF, "EOF", TokenConstants.DefaultChannel, start, stop, Line, Column);}return eofToken;}IToken t = tokens[i];if (i == tokens.Count - 1 && t.Type == TokenConstants.EOF){eofToken = t;}i++;return t;}
