private void DumpPreOrderIterator <T>(T tree, DfsIterator <T> iterator) { string sep = ""; foreach (T node in iterator.PreOrder(tree)) { sb.Append(sep); sep = ","; sb.Append(node.ToString()); } }
public void BuildNodes() { int bId = 0; var iterator = new DfsIterator <Block>(proc.ControlGraph); foreach (Block b in iterator.PreOrder(proc.EntryBlock)) { var cfgNode = new StructureNode(b, ++bId); nodeList.Add(cfgNode); blockNodes.Add(b, cfgNode); } if (!blockNodes.ContainsKey(proc.ExitBlock)) { var cfgNode = new StructureNode(proc.ExitBlock, ++bId); nodeList.Add(cfgNode); blockNodes.Add(proc.ExitBlock, cfgNode); } }