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)
4
using ICSharpCode.SharpDevelop.Editor;
6
using ICSharpCode.SharpDevelop.Dom;
8
namespace ICSharpCode.SharpDevelop.Project
11
/// Represents a language parser that produces ICompilationUnit instances
14
public interface IParser
21
LanguageProperties Language {
25
IExpressionFinder CreateExpressionFinder(string fileName);
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
32
bool CanParse(string fileName);
35
/// Gets if the parser can parse the specified project.
36
/// Only when no parser for a project is found, the assembly is loaded.
38
bool CanParse(IProject project);
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>
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.
51
ICompilationUnit Parse(IProjectContent projectContent, string fileName, ITextBuffer fileContent);
53
IResolver CreateResolver();