public String toString(Recognizer<?, ?> r) {
		String channelStr = "";
		if ( channel>0 ) {
			channelStr=",channel="+channel;
		}
		String txt = getText();
		if ( txt!=null ) {
			txt = txt.replace("\n","\\n");
			txt = txt.replace("\r","\\r");
			txt = txt.replace("\t","\\t");
		}
		else {
			txt = "<no text>";
		}
		String typeString = String.valueOf(type);
		if ( r!=null ) {
			typeString = r.getVocabulary().getDisplayName(type);
		}
		return "[@"+getTokenIndex()+","+start+":"+stop+"='"+txt+"',<"+typeString+">"+channelStr+","+line+":"+getCharPositionInLine()+"]";
	}
Explicitly set the text for this token. If {code text} is not
{@code null}, then {@link #getText} will return this value rather than
extracting the text from the input.

@param text The explicit text of the token, or {@code null} if the text
should be obtained from the input along with the start and stop indexes
of the token.
runtime/Java/src/org/antlr/v4/runtime/CommonToken.java