Example #1
0
        //============================================================
        // <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;
                        }
                    }
                }
            }
        }
Example #2
0
        //============================================================
        // <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);
                }
            }
        }
Example #3
0
        public bool IsClassAnnotateFine(FCsClass csClass)
        {
            FStrings classAnnos = GetAnnotate(csClass.StrLine, csClass.BeginIndex);
            bool     bLabelFine = true, bAuthorfine = true, bParentfine = true, bImplementFine = true;

            bLabelFine  = IsExistInAnnotate(classAnnos, "<T>");
            bAuthorfine = IsExistInAnnotate(classAnnos, "@author");
            if (csClass.ParentsName != null && csClass.ParentsName != "")
            {
                bParentfine = IsExistInAnnotate(classAnnos, "@exist") && IsExistInAnnotate(classAnnos, csClass.ParentsName);
            }
            if (csClass.Interface != null && csClass.Interface.Length != 0)
            {
                for (int n = 0; n < csClass.Interface.Length; n++)
                {
                    if (!IsExistInAnnotate(classAnnos, csClass.Interface[n]))
                    {
                        bImplementFine = false;
                    }
                }
            }
            return(bLabelFine && bAuthorfine && bParentfine && bImplementFine);
        }