public void WriteGraphStart_Should_Write_Name() { var stringBuilder = new StringBuilder(); var writer = new DotWriter(new StringWriter(stringBuilder)); writer.WriteGraphStart("test"); stringBuilder.ToString().Should().BeIgnoringLineEndings("digraph \"test\" {\r\n"); }
public void Visit(string methodName, IControlFlowGraph cfg) { writer.WriteGraphStart(methodName); foreach (var block in cfg.Blocks) { Visit(block); } writer.WriteGraphEnd(); }
public void Visit(string methodName, UCFG ucfg) { writer.WriteGraphStart(methodName); writer.WriteNode(EntryBlockId, EntryBlockId, ucfg.Parameters.ToArray()); foreach (var entry in ucfg.Entries) { writer.WriteEdge(EntryBlockId, entry, string.Empty); } foreach (var block in ucfg.BasicBlocks) { Visit(block); } writer.WriteNode(ExitBlockId, ExitBlockId); writer.WriteGraphEnd(); }