@Override
	public String getText() {
		if ( text!=null ) {
			return text;
		}

		CharStream input = getInputStream();
		if ( input==null ) return null;
		int n = input.size();
		if ( start<n && stop<n) {
			return input.getText(Interval.of(start,stop));
		}
		else {
			return "<EOF>";
		}
	}
Constructs a new {@link CommonToken} as a copy of another {@link Token}.

<p>
If {@code oldToken} is also a {@link CommonToken} instance, the newly
constructed token will share a reference to the {@link #text} field and
the {@link Pair} stored in {@link #source}. Otherwise, {@link #text} will
be assigned the result of calling {@link #getText}, and {@link #source}
will be constructed from the result of {@link Token#getTokenSource} and
{@link Token#getInputStream}.</p>

@param oldToken The token to copy.
runtime/Java/src/org/antlr/v4/runtime/CommonToken.java