示例#1
0
        // Code changed by JZ: solution monitor integration
        /// <summary>
        /// New Parse method that takes both source file path and the XElement representation of the source file as input arguments.
        /// TODO: what if the XElement is null?
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="sourceElements"></param>
        /// <returns></returns>
        public List <ProgramElement> Parse(string fileName, XElement sourceElements)
        {
            var programElements = new List <ProgramElement>();

            //classes and structs have to be parsed first
            ParseClasses(programElements, sourceElements, fileName);
            ParseStructs(programElements, sourceElements, fileName);

            ParseEnums(programElements, sourceElements, fileName, snippetSize);
            SrcMLParsingUtils.ParseFields(programElements, sourceElements, fileName);
            ParseConstructors(programElements, sourceElements, fileName);
            ParseMethods(programElements, sourceElements, fileName);
            ParseProperties(programElements, sourceElements, fileName);
            SrcMLParsingUtils.ParseComments(programElements, sourceElements, fileName);

            return(programElements);
        }
示例#2
0
        // Code changed by JZ: solution monitor integration
        /// <summary>
        /// New Parse method that takes both source file path and the XElement representation of the source file as input arguments.
        /// TODO: what if the XElement is null?
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="sourceElements"></param>
        /// <returns></returns>
        public List <ProgramElement> Parse(string fileName, XElement sourceElements)
        {
            var programElements = new List <ProgramElement>();

            //classes and structs have to parsed first
            ParseClasses(programElements, sourceElements, fileName);
            ParseStructs(programElements, sourceElements, fileName);

            SrcMLParsingUtils.ParseFields(programElements, sourceElements, fileName);
            ParseCppEnums(programElements, sourceElements, fileName);
            ParseConstructors(programElements, sourceElements, fileName);
            ParseFunctions(programElements, sourceElements, fileName);
            ParseCppFunctionPrototypes(programElements, sourceElements, fileName);
            ParseCppConstructorPrototypes(programElements, sourceElements, fileName);
            SrcMLParsingUtils.ParseComments(programElements, sourceElements, fileName);

            return(programElements);
        }