コード例 #1
0
        /// <summary>
        /// Gets parse information for the specified file.
        /// Blocks if the file wasn't parsed yet, but may return an old parsed version.
        /// This method is thread-safe. This method involves waiting for the main thread, so using it while
        /// holding a lock can lead to deadlocks. You might want to use <see cref="GetExistingParseInformation"/> instead.
        /// </summary>
        /// <returns>Returns the ParseInformation for the specified file, or null if the file cannot be parsed.
        /// The returned ParseInformation might be stale (re-parse is not forced).</returns>
//        public static ParseInformation GetParseInformation(string text, IProjectContent)
//        {
//            if (string.IsNullOrEmpty(text))
//                return null;
//            return new ParseInformation(CreateParser(text, TODO));
//        }

        public static ParseInformation GetParseInformation(string text, IProjectContent projectContent)
        {
            if (string.IsNullOrEmpty(text))
            {
                return(null);
            }
            return(new ParseInformation(TParser.Parse(projectContent, text)));
        }
コード例 #2
0
 /// <summary>
 /// Creates a new IParser instance that can parse the specified file.
 /// This method is thread-safe.
 /// </summary>
 public static ICompilationUnit CreateParser(string text, IProjectContent projectContent)
 {
     return(TParser.Parse(projectContent, text));
 }