C# Class Rosetta.Tests.Utils.NodeLocator

Locates nodes in an AST.
显示文件 Open project: andry-tino/Rosetta Class Usage Examples

Public Methods

Method Description
LocateAll ( Type nodeType ) : IEnumerable

Gets all occurrances of a node type in the AST.

LocateFirst ( Type nodeType ) : Microsoft.CodeAnalysis.SyntaxNode

Gets the first occurrance of a node type in the AST.

LocateLast ( Type nodeType ) : Microsoft.CodeAnalysis.SyntaxNode

Gets the last occurrance of a node type in the AST.

NodeLocator ( Microsoft.CodeAnalysis.SyntaxNode syntaxNode ) : System

Initializes a new instance of the NodeLocator class.

NodeLocator ( Microsoft.CodeAnalysis.SyntaxTree syntaxTree ) : System

Initializes a new instance of the NodeLocator class.

Private Methods

Method Description
ValidateInputType ( Type type ) : void

Method Details

LocateAll() public method

Gets all occurrances of a node type in the AST.
public LocateAll ( Type nodeType ) : IEnumerable
nodeType System.Type The node type to look for.
return IEnumerable

LocateFirst() public method

Gets the first occurrance of a node type in the AST.
public LocateFirst ( Type nodeType ) : Microsoft.CodeAnalysis.SyntaxNode
nodeType System.Type The node type to look for.
return Microsoft.CodeAnalysis.SyntaxNode

LocateLast() public method

Gets the last occurrance of a node type in the AST.
public LocateLast ( Type nodeType ) : Microsoft.CodeAnalysis.SyntaxNode
nodeType System.Type The node type to look for.
return Microsoft.CodeAnalysis.SyntaxNode

NodeLocator() public method

Initializes a new instance of the NodeLocator class.
public NodeLocator ( Microsoft.CodeAnalysis.SyntaxNode syntaxNode ) : System
syntaxNode Microsoft.CodeAnalysis.SyntaxNode
return System

NodeLocator() public method

Initializes a new instance of the NodeLocator class.
public NodeLocator ( Microsoft.CodeAnalysis.SyntaxTree syntaxTree ) : System
syntaxTree Microsoft.CodeAnalysis.SyntaxTree
return System