// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; namespace ICSharpCode.SharpDevelop.Dom { /// /// Holds the parse information for a file. /// This class is immutable and thread-safe. /// public class ParseInformation : Immutable { ICompilationUnit unit; /// /// Gets the compilation unit. /// This property never returns null. /// public ICompilationUnit CompilationUnit { get { return unit; } } /// /// Gets the last compilation unit that was valid (=no parse errors). /// This property might be null. /// [ObsoleteAttribute] public ICompilationUnit ValidCompilationUnit { get { return unit; } } /// /// Gets the last compilation unit that was invalid (=had parse errors). /// This property is null if the most recent compilation unit is valid. /// [ObsoleteAttribute] public ICompilationUnit DirtyCompilationUnit { get { return unit; } } /// /// Gets the best compilation unit. /// This returns the ValidCompilationUnit if one exists, otherwise /// the DirtyCompilationUnit. /// [ObsoleteAttribute] public ICompilationUnit BestCompilationUnit { get { return unit; } } /// /// Gets the most recent compilation unit. The unit might be valid or invalid. /// [ObsoleteAttribute] public ICompilationUnit MostRecentCompilationUnit { get { return unit; } } public ParseInformation(ICompilationUnit unit) { if (unit == null) throw new ArgumentNullException("unit"); unit.Freeze(); // if (!unit.IsFrozen) // throw new ArgumentException("unit must be frozen for use in ParseInformation"); this.unit = unit; } } }