Ejemplo n.º 1
0
 private void AddTreeNode(TreeNode parent, PegNode node, NodeToString nodeToString)
 {
     if (node == null) return;
     string txt = nodeToString(node);
     if (node.parent_ == null) txt = "^" + txt;
     TreeNode tn = (parent == null ? tvParseTree.Nodes.Add(txt) : parent.Nodes.Add(txt));
     tn.Tag = node;
     AddTreeNode(tn, node.child_, nodeToString);
     AddTreeNode(parent, node.next_, nodeToString);
 }
Ejemplo n.º 2
0
        private void AddTreeNode(TreeNode parent, PegNode node, NodeToString nodeToString)
        {
            if (node == null)
            {
                return;
            }
            string txt = nodeToString(node);

            if (node.parent_ == null)
            {
                txt = "^" + txt;
            }
            TreeNode tn = (parent == null ? tvParseTree.Nodes.Add(txt) : parent.Nodes.Add(txt));

            tn.Tag = node;
            AddTreeNode(tn, node.child_, nodeToString);
            AddTreeNode(parent, node.next_, nodeToString);
        }
Ejemplo n.º 3
0
        public string GetNodePathAsString(char separator, NodeToString <T> toString)
        {
            string        s    = "";
            DTreeNode <T> node = this;

            while (node != null)
            {
                if (s.Length != 0)
                {
                    s = toString(node) + separator + s;
                }
                else
                {
                    s = toString(node);
                }
                node = node.Parent;
            }

            return(s);
        }
Ejemplo n.º 4
0
 private void BuildTree(PegNode root, NodeToString nodeToString)
 {
     tvParseTree.Nodes.Clear();
     AddTreeNode(null, root, nodeToString);
     ExpandTop(10);
 }
Ejemplo n.º 5
0
 private void BuildTree(PegNode root, NodeToString nodeToString)
 {
     tvParseTree.Nodes.Clear();
     AddTreeNode(null, root, nodeToString);
     ExpandTop(100);
 }