Antlr4.Runtime.Tree.Trees.Descendants C# (CSharp) Method

Descendants() public static method

public static Descendants ( IParseTree t ) : IList
t IParseTree
return IList
        public static IList<IParseTree> Descendants(IParseTree t)
        {
            List<IParseTree> nodes = new List<IParseTree>();
            nodes.Add(t);
            int n = t.ChildCount;
            for (int i = 0; i < n; i++)
            {
                nodes.AddRange(Descendants(t.GetChild(i)));
            }
            return nodes;
        }