Ejemplo n.º 1
0
        public void Traverse(CallGraph cgraph, Procedure rootProc)
        {
            var q = new Queue <Procedure>();

            q.Enqueue(rootProc);
            while (q.Count > 0)
            {
                var proc = q.Dequeue();
                if (visited.Contains(proc))
                {
                    continue;
                }
                visited.Add(proc);
                Debug.Print("Node {0}", proc.Name);
                visited.Add(proc);
                var n = Render(proc);
                foreach (var pred in cgraph.CallerProcedures(proc).Where(p => p != rootProc))
                {
                    Debug.Print("Edge {0} - {1}", pred.Name, proc.Name);
                    graph.AddEdge(pred.Name, proc.Name);
                }
                foreach (var succ in cgraph.Callees(proc))
                {
                    q.Enqueue(succ);
                }
            }
        }
Ejemplo n.º 2
0
 public void Traverse(CallGraph cgraph, Procedure rootProc)
 {
     var q = new Queue<Procedure>();
     q.Enqueue(rootProc);
     while (q.Count > 0)
     {
         var proc = q.Dequeue();
         if (visited.Contains(proc))
             continue;
         visited.Add(proc);
         Debug.Print("Node {0}", proc.Name);
         visited.Add(proc);
         Render(proc);
         foreach (var pred in cgraph.CallerProcedures(proc).Where(p => p != rootProc))
         {
             Debug.Print("Edge {0} - {1}", pred.Name, proc.Name);
             graph.AddEdge(pred.Name, proc.Name);
         }
         foreach (var succ in cgraph.Callees(proc))
         {
             q.Enqueue(succ);
         }
     }
 }