Exemplo n.º 1
0
        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");
        }
Exemplo n.º 2
0
            public void Visit(string methodName, IControlFlowGraph cfg)
            {
                writer.WriteGraphStart(methodName);

                foreach (var block in cfg.Blocks)
                {
                    Visit(block);
                }

                writer.WriteGraphEnd();
            }
Exemplo n.º 3
0
            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();
            }