Ejemplo n.º 1
0
        public string CreateDiagram(string code, string diagramFilepath, bool closeAfterBuild)
        {
            code = Language.CodeCleaner.CleanCodeBeforeParse(code);
            var tokens = Language.CodeTokenizer.TokenizeCode(code);

            tokens = Language.TokenFilterChain.DoFilters(tokens);
            var codeAst = Language.CodeParser.ParseCode(tokens);

            codeAst = Language.ThreeStructureController.OptimizeStructure(codeAst);
            codeAst = Language.TextController.ApplyTextRules(codeAst);
            var diagramFilename = DiagramBuilder.BuildDiagram(codeAst, closeAfterBuild, diagramFilepath);

            return(diagramFilename);
        }
Ejemplo n.º 2
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);
        }