// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.NRefactory.CSharp.Resolver
{
///
/// Allows controlling which nodes are resolved by the resolve visitor.
///
///
public interface IResolveVisitorNavigator
{
ResolveVisitorNavigationMode Scan(AstNode node);
}
///
/// Represents the operation mode of the resolve visitor.
///
///
public enum ResolveVisitorNavigationMode
{
///
/// Scan into the children of the current node, without resolving the current node.
///
Scan,
///
/// Skip the current node - do not scan into it; do not resolve it.
///
Skip,
///
/// Resolve the current node; but only scan subnodes which are not required for resolving the current node.
///
Resolve,
///
/// Resolves all nodes in the current subtree.
///
ResolveAll
}
sealed class ConstantModeResolveVisitorNavigator : IResolveVisitorNavigator
{
ResolveVisitorNavigationMode mode;
public static readonly IResolveVisitorNavigator Skip = new ConstantModeResolveVisitorNavigator { mode = ResolveVisitorNavigationMode.Skip };
ResolveVisitorNavigationMode IResolveVisitorNavigator.Scan(AstNode node)
{
return mode;
}
}
}