//============================================================ // <T>解析单个文件。</T> // // @param file 要解析的文件 //============================================================ public void ParserSingleFile(FileInfo file) { FStrings strLines = FCsParser.GetLines(new FFileInfo(file.FullName)); for (int n = 0; n < strLines.Count; n++) { if (FCsParser.IsSpace(strLines[n].ToString())) { string space = string.Empty; int endindex = FCsSpace.ParserSpace(strLines, n, out space); int start, end = CheckParaAnnotate(strLines, n, out start); for (int i = n; i < endindex; i++) { if (IsInInterregional(i, start, end)) { continue; } if (FCsSpace.IsClass(strLines[i].ToString())) { string classStr = FCsClass.ParserClass(strLines, i); FMapNode node = new FMapNode(classStr, space); AddNode(node); n = i; } } } } }
//============================================================ // <T>获取命名空间。</T> // @parame strline 需要获取的字符串集合。 // @param index 当前索引 // @return 获取的命名空间对象 //============================================================ public void ParserSpace(FStrings strLine, int index, string path, FClassesIndexTable indextable, StreamWriter swPrint, FileInfo file, string relative) { int start, end = CheckParaAnnotate(strLine, index, out start); for (index++; index < strLine.Count; index++) { if (IsInInterregional(index, start, end)) { continue; } if (IsClass(strLine[index])) { int endIndex = GetPairNum(strLine, index); FCsClass aclass = new FCsClass( ); aclass.FillValue(strLine, index, endIndex); aclass.ParserClass(strLine, this, index, path, indextable, swPrint, file, relative); this.Class.Add(aclass); } } }