예제 #1
0
 public void AddChild(DominatorTreeNode child)
 {
     if (!ChildrenNodes.Contains(child))
     {
         ChildrenNodes.Add(child);
     }
 }
예제 #2
0
파일: DominatorTree.cs 프로젝트: koyre/b8
        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);
        }
예제 #3
0
 public DominatorTreeNode(CFGNode cfgNode, DominatorTreeNode parent, IEnumerable <DominatorTreeNode> children)
 {
     CFGNode       = cfgNode;
     ParentNode    = parent;
     ChildrenNodes = new List <DominatorTreeNode>(children) ?? new List <DominatorTreeNode>();
 }