//============================================================ // <T>解析单个文件</T> // // @param file 要解析的文件 //============================================================ public void ParserSingleFile(FileInfo file) { FStrings strLines = FAsParser.GetLines(file.FullName); for (int n = 0; n < strLines.Count; n++) { if (FAsPackage.IsPackage(strLines, n)) { string package = string.Empty; int endindex = FAsPackage.ParserPackage(strLines, n, out package); int start, end = CheckParaAnnotate(strLines, n, out start); for (int i = n; i < endindex; i++) { if (IsInInterregional(i, start, end)) { continue; } if (FAsClass.IsClass(strLines, i)) { string classStr = FAsClass.ParserClass(strLines, i); FMapNode node = new FMapNode(classStr, package); AddNode(node); n = i; } } } } }
//============================================================ // <T>解析文件。</T> // @parame fileinfo 要解析的文件 // @param index 解析对象 //============================================================ public void ParserFile(FileInfo file, string outputPath, FAsClassesIndexTable indextable, StreamWriter swPrint, string relative) { FStrings lines = GetLines(file.DirectoryName + "\\" + file.Name); _savePath = outputPath; for (int n = 0; n < lines.Count; n++) { if (FAsPackage.IsPackage(lines, n)) { FAsPackage package = new FAsPackage(lines, n, GetPairNum(lines, n)); string path = outputPath + "\\" + package.PackageString.Trim(); package.ParserPackage(indextable, path, swPrint, file, relative); } } }