protected void add(Token t) {
		if ( n>=tokens.length ) {
			tokens = Arrays.copyOf(tokens, tokens.length * 2);
		}

		if (t instanceof WritableToken) {
			((WritableToken)t).setTokenIndex(getBufferStartIndex() + n);
		}

		tokens[n++] = t;
	}
Add {@code n} elements to the buffer. Returns the number of tokens
actually added to the buffer. If the return value is less than {@code n},
then EOF was reached before {@code n} tokens could be added.
runtime/Java/src/org/antlr/v4/runtime/UnbufferedTokenStream.java