public void AddChild(DominatorTreeNode child) { if (!ChildrenNodes.Contains(child)) { ChildrenNodes.Add(child); } }
private bool isWayExists(DominatorTreeNode from, DominatorTreeNode to) { if (from.Equals(to)) { return(true); } visited.Add(from); var nodes = graph.Edges.Where(dtn => dtn.Source.Equals(from)) .Select(dtn => dtn.Target) .Where(dtn => !visited.Contains(dtn)).ToList(); foreach (var node in nodes) { if (isWayExists(node, to)) { return(true); } } return(false); }
public DominatorTreeNode(CFGNode cfgNode, DominatorTreeNode parent, IEnumerable <DominatorTreeNode> children) { CFGNode = cfgNode; ParentNode = parent; ChildrenNodes = new List <DominatorTreeNode>(children) ?? new List <DominatorTreeNode>(); }