Exemple #1
0
        //// _nodes_string returns a string for a series of nodes, and the caller
        //// needs to supply the open and close parens that bracket the series.
        ////
        private string NodesString(ParsedNode nodes)
        {
            var res = "";

            while (nodes.Next != null)
            {
                // Get one node's string with a leading newline if it is not the
                // first.
                res += nodes.NodeString(res != "");
                if (nodes.Branches != null)
                {
                    foreach (var n in nodes.Branches)
                    {
                        res = res + Environment.NewLine + "(" + this.NodesString(n) + ")";
                    }
                    return(res);
                }
                nodes = nodes.Next;
            }
            res += nodes.NodeString(res != ""); // Test res, could be single node branch.
            return(res);
        }