~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/Main/Base/Project/Src/Project/IParser.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using ICSharpCode.SharpDevelop.Editor;
 
5
using System;
 
6
using ICSharpCode.SharpDevelop.Dom;
 
7
 
 
8
namespace ICSharpCode.SharpDevelop.Project
 
9
{
 
10
        /// <summary>
 
11
        /// Represents a language parser that produces ICompilationUnit instances
 
12
        /// for code files.
 
13
        /// </summary>
 
14
        public interface IParser
 
15
        {
 
16
                string[] LexerTags {
 
17
                        get;
 
18
                        set;
 
19
                }
 
20
                
 
21
                LanguageProperties Language {
 
22
                        get;
 
23
                }
 
24
                
 
25
                IExpressionFinder CreateExpressionFinder(string fileName);
 
26
                
 
27
                /// <summary>
 
28
                /// Gets if the parser can parse the specified file.
 
29
                /// This method is used to get the correct parser for a specific file and normally decides based on the file
 
30
                /// extension.
 
31
                /// </summary>
 
32
                bool CanParse(string fileName);
 
33
                
 
34
                /// <summary>
 
35
                /// Gets if the parser can parse the specified project.
 
36
                /// Only when no parser for a project is found, the assembly is loaded.
 
37
                /// </summary>
 
38
                bool CanParse(IProject project);
 
39
                
 
40
                /// <summary>
 
41
                /// Parses a file.
 
42
                /// </summary>
 
43
                /// <param name="projectContent">The parent project of the file.</param>
 
44
                /// <param name="fileName">The name of the file being parsed.</param>
 
45
                /// <param name="fileContent">The content of the file.</param>
 
46
                /// <returns>The compilation unit representing the parse results.</returns>
 
47
                /// <remarks>
 
48
                /// SharpDevelop may call IParser.Parse in parallel. This will be done on the same IParser instance
 
49
                /// if there are two parallel parse requests for the same file. Parser implementations must be thread-safe.
 
50
                /// </remarks>
 
51
                ICompilationUnit Parse(IProjectContent projectContent, string fileName, ITextBuffer fileContent);
 
52
                
 
53
                IResolver CreateResolver();
 
54
        }
 
55
}