Beispiel #1
0
 public static void PrintTree(ExpressionTreeBase treeItem, int indent)
 {
     string add = "";
     for (int i = 0; i < indent; i++)
     {
         add += "  ";
     }
     Console.Out.WriteLine(add + treeItem);
     indent++;
     if (treeItem is GetExpression)
     {
         Console.Out.WriteLine(add + "Types: ");
         foreach (GetTypes current in ((GetExpression)treeItem).Types)
         {
             Console.Out.WriteLine(add + current);
         }
         Console.Out.WriteLine(add + "Conditions: ");
     }
     if (treeItem is MultiNodeTree)
     {
         foreach (ExpressionTreeBase current in ((MultiNodeTree)treeItem).Children)
         {
             PrintTree(current, indent);
         }
     }
     else if (treeItem is SingleNodeTree)
     {
         PrintTree(((SingleNodeTree)treeItem).Child, indent);
     }
     if (treeItem is ConditionalExpression)
     {
         if (((ConditionalExpression)treeItem).AdditionalConditions.Count > 0)
         {
             //Console.Out.WriteLine(add + "Additional Conditions:");
             foreach (ConditionalExpression current in ((ConditionalExpression)treeItem).AdditionalConditions)
             {
                 PrintTree(current, indent);
             }
         }
     }
 }
Beispiel #2
0
 public void AddChild(ExpressionTreeBase child)
 {
     _children.Add(child);
     child.SetParent(this);
 }
 public void SetParent(ExpressionTreeBase parent)
 {
     Parent = parent;
     Root = parent.Root;
 }
Beispiel #4
0
 public void SetParent(ExpressionTreeBase parent)
 {
     Parent = parent;
     Root   = parent.Root;
 }
Beispiel #5
0
 public void SetChild(ExpressionTreeBase child)
 {
     Child = child;
     Child.SetParent(this);
 }
Beispiel #6
0
 public void SetChild(ExpressionTreeBase child)
 {
     Child = child;
     Child.SetParent(this);
 }
Beispiel #7
0
 public void AddChild(ExpressionTreeBase child)
 {
     _children.Add(child);
     child.SetParent(this);
 }