示例#1
0
        public string CreateDiagram(DiagramCreateProps diagramCreateProps)
        {
            var code   = Language.CleanCodeBeforeParse(diagramCreateProps.Code);
            var tokens = Language.TokenizeCode(code);

            tokens = Language.FilterTokens(tokens);
            var codeAst = Language.ParseTokens(tokens);

            codeAst = Language.ApplyNodeTextRules(codeAst);
            codeAst = Language.OptimizeMethodsStructure(codeAst);
            var diagramFilename = DiagramBuilder.BuildDiagram(codeAst, diagramCreateProps.CloseDiagramAfterBuild,
                                                              diagramCreateProps.DiagramPath);

            return(diagramFilename);
        }