public override string ToString()
{
string channelStr = string.Empty;
if (Channel > 0)
channelStr = ",channel=" + Channel;
string txt = Text;
if (txt != null)
txt = Utility.ReplaceEscapes(txt);
else
txt = "<no text>";
string tokenName;
if (Type == EOF_TYPE)
tokenName = "EOF";
else
tokenName = TemplateParser.tokenNames[Type];
return string.Format("[@{0},{1}:{2}='{3}',<{4}>{5},{6}:{7}]", TokenIndex, StartIndex, StopIndex, txt, tokenName, channelStr, Line, CharPositionInLine);
}