//-----------------< Function to check dependency based on namespaces >--------- public static void checkDependencyNamespace(List <DependencyCheck> nspaceList, List <List <Elem> > listOfTables, List <string> file, List <Tuple <string, string> > graph) { for (int j = 0; j < nspaceList.Count; j++) { for (int i = 0; i < nspaceList.Count; i++) { if (nspaceList[j].Typename == nspaceList[i].Typename && j != i) { SecondParse.secondParse(nspaceList[j].Filename, nspaceList[i].Filename, listOfTables, file, graph); } } } }
//-----------------< Function to check dependency based on alias >--------- public static void checkDependencyAlias(List <DependencyCheck> nspaceList, List <DependencyCheck> usingList, List <List <Elem> > listOfTables, List <string> file, List <Tuple <string, string> > graph) { for (int j = 0; j < nspaceList.Count; j++) { for (int k = 0; k < usingList.Count; k++) { if (nspaceList[j].Typename == usingList[k].AliasName) { SecondParse.secondParse(nspaceList[j].Filename, usingList[k].Filename, listOfTables, file, graph); } } } }
//-----------------< Second parse function to check for dependency >--------- public static void secondParse(string firstFile, string SecondFile, List <List <Elem> > listOfTables, List <string> files, List <Tuple <string, string> > graph) { ITokenCollection semi = Factory.create(); string secondFilepath = null; foreach (var file in files) { if (file.Contains(SecondFile)) { secondFilepath = file; break; } } if (!semi.open(secondFilepath as string)) { Console.Write("\n Can't open {0}\n\n", SecondFile); } while (true) { if (SecondParse.ParseForClass(firstFile, SecondFile, semi, listOfTables, graph)) { break; } semi.open(secondFilepath as string); if (SecondParse.ParseForInterface(firstFile, SecondFile, semi, listOfTables, graph)) { break; } semi.open(secondFilepath as string); if (SecondParse.ParseForStruct(firstFile, SecondFile, semi, listOfTables, graph)) { break; } semi.open(secondFilepath as string); if (SecondParse.ParseForEnum(firstFile, SecondFile, semi, listOfTables, graph)) { break; } semi.open(secondFilepath as string); if (SecondParse.ParseForDelegate(firstFile, SecondFile, semi, listOfTables, graph)) { break; } break; } }