text: public static string GetNodeText(ITree t, IList<string> ruleNames){if (ruleNames != null){if (t is RuleContext){int ruleIndex = ((RuleContext)t).RuleIndex;string ruleName = ruleNames[ruleIndex];int altNumber = ((RuleContext)t).getAltNumber();if ( altNumber!=Atn.ATN.INVALID_ALT_NUMBER ) {return ruleName+":"+altNumber;}return ruleName;}else{if (t is IErrorNode){return t.ToString();}else{if (t is ITerminalNode){IToken symbol = ((ITerminalNode)t).Symbol;if (symbol != null){string s = symbol.Text;return s;}}}}}object payload = t.Payload;if (payload is IToken){return ((IToken)payload).Text;}return t.Payload.ToString();}