public virtual string GetTokenDisplayName(int ttype)
{
// inside any target's char range and is lexer grammar?
if (IsLexer() &&
ttype >= Lexer.MinCharValue && ttype <= Lexer.MaxCharValue)
{
return CharSupport.GetANTLRCharLiteralForChar(ttype);
}
if (ttype == TokenConstants.Eof)
{
return "EOF";
}
if (ttype == TokenConstants.InvalidType)
{
return INVALID_TOKEN_NAME;
}
if (ttype >= 0 && ttype < typeToStringLiteralList.Count && typeToStringLiteralList[ttype] != null)
{
return typeToStringLiteralList[ttype];
}
if (ttype >= 0 && ttype < typeToTokenList.Count && typeToTokenList[ttype] != null)
{
return typeToTokenList[ttype];
}
return ttype.ToString();
}