private static IEnumerable <T> GetFlattenedSymbolsOfKind <T>(
            IContainerSymbol parent,
            SymbolKind kind)
        {
            ImmutableArray <ISymbol> members = parent.GetMembers();
            List <T>        objList          = new List <T>();
            Stack <ISymbol> symbolStack      = new Stack <ISymbol>();

            foreach (ISymbol symbol1 in members)
            {
                symbolStack.Push(symbol1);
                while (symbolStack.Count > 0)
                {
                    ISymbol symbol2 = symbolStack.Pop();
                    if (symbol2.Kind == kind)
                    {
                        objList.Add((T)symbol2);
                        foreach (ISymbol member in ((IContainerSymbol)symbol2).GetMembers())
                        {
                            symbolStack.Push(member);
                        }
                    }
                }
            }
            return((IEnumerable <T>)objList);
        }