void DependencyResult(List <string> files, string dependencyresult, bool flag) { Repository repo = Repository.getInstance(); ITokenCollection semi = Factory.create(); BuildDepAnalyzer builder2 = new BuildDepAnalyzer(semi); Parser parser = builder2.build(); repo.locations.Clear(); foreach (string file in files) { //Console.Write("\n file: {0}", file); if (file.Contains("TemporaryGeneratedFile") || file.Contains("AssemblyInfo")) { continue; } if (!semi.open(file as string)) { Console.Write("\n Can't open {0}\n\n", file); break; } List <string> deps = new List <string>(); repo.dependencyTable.addParent(file); repo.currentFile = file; try { while (semi.get().Count > 0) { //semi.show(); parser.parse(semi); } } catch (Exception ex) { Console.Write("\n\n {0}\n", ex.Message); } } if (flag) { repo.dependencyTable.show(); repo.dependencyTable.DependencyFile(dependencyresult); } }
//----< build dependency table by parsing for type usage >------- public void dependencyAnalysis(List <string> files) { var repo = Repository.getInstance(); var semi = Factory.create(); var builder2 = new BuildDepAnalyzer(semi); var parser = builder2.build(); repo.locations.Clear(); foreach (var file in files) { //Console.Write("\n file: {0}", file); if (file.Contains("TemporaryGeneratedFile") || file.Contains("AssemblyInfo")) { continue; } if (!semi.open(file)) { Console.Write("\n Can't open {0}\n\n", file); break; } var deps = new List <string>(); repo.dependencyTable.addParent(file); repo.currentFile = file; try { while (semi.get().Count > 0) { //semi.show(); parser.parse(semi); } } catch (Exception ex) { Console.Write("\n\n {0}\n", ex.Message); } } }