コード例 #1
0
ファイル: CodeTree.cs プロジェクト: Zarion/PMKompilatorv2
        public void ShowTree(CodeTree tree)
        {
            string thisNode = "";
            thisNode += tree.Value;
            thisNode += ": ";
            int childsNumber = tree.NumberOfChilds;

            for (int i = 0; i < childsNumber; i++)
            {
                thisNode += tree.GetChildValue(i + 1);
                thisNode += " ";
                ShowTree(tree.GetChild(i + 1));
            }

            Console.WriteLine(thisNode);
        }
コード例 #2
0
ファイル: CodeTree.cs プロジェクト: Zarion/PMKompilatorv2
 //Dodanie dziecka do węzła - dodaje na sam koniec listy dzieci
 public void AddChild(CodeTree child, ref CodeTree parent)
 {
     child.Parent = parent;
     Childs.Add(child);
 }