C# Class ICSharpCode.NRefactory.CSharp.Resolver.DetectSkippableNodesNavigator

When an IResolveVisitorNavigator is searching for specific nodes (e.g. all IdentifierExpressions), it has to scan the whole syntax tree for those nodes. However, scanning in the ResolveVisitor is expensive (e.g. any lambda that is scanned must be resolved), so it makes sense to detect when a whole subtree is scan-only, and skip that tree instead. The DetectSkippableNodesNavigator performs this job by running the input IResolveVisitorNavigator over the whole AST, and detecting subtrees that are scan-only, and replaces them with Skip.
Inheritance: IResolveVisitorNavigator
Show file Open project: 0xd4d/NRefactory Class Usage Examples

Public Methods

Method Description
DetectSkippableNodesNavigator ( IResolveVisitorNavigator navigator, AstNode root ) : System.Collections.Generic
ProcessConversion ( Expression expression, ResolveResult result, Conversion conversion, IType targetType ) : void
Resolved ( AstNode node, ResolveResult result ) : void
Scan ( AstNode node ) : ResolveVisitorNavigationMode

Private Methods

Method Description
Init ( AstNode node ) : bool

Method Details

DetectSkippableNodesNavigator() public method

public DetectSkippableNodesNavigator ( IResolveVisitorNavigator navigator, AstNode root ) : System.Collections.Generic
navigator IResolveVisitorNavigator
root AstNode
return System.Collections.Generic

ProcessConversion() public method

public ProcessConversion ( Expression expression, ResolveResult result, Conversion conversion, IType targetType ) : void
expression Expression
result ResolveResult
conversion Conversion
targetType IType
return void

Resolved() public method

public Resolved ( AstNode node, ResolveResult result ) : void
node AstNode
result ResolveResult
return void

Scan() public method

public Scan ( AstNode node ) : ResolveVisitorNavigationMode
node AstNode
return ResolveVisitorNavigationMode