Click or drag to resize

SyntaxWalker Class



Walks the syntax tree, allowing subclasses to operate on all nodes, token and trivia. The walker will perform a depth first walk of the tree.
Inheritance Hierarchy
SystemObject
  Microsoft.CodeAnalysisSyntaxWalker

Namespace:  Microsoft.CodeAnalysis
Assembly:  Microsoft.CodeAnalysis (in Microsoft.CodeAnalysis.dll) Version: 2.3.0-dev-56735-00. Commit Hash: <developer build>
Syntax
public abstract class SyntaxWalker

The SyntaxWalker type exposes the following members.

Constructors
  NameDescription
Protected methodSyntaxWalker
Creates a new walker instance.
Top
Properties
  NameDescription
Protected propertyDepth
Syntax the SyntaxWalker should descent into.
Top
Methods
  NameDescription
Public methodVisit
Called when the walker visits a node. This method may be overridden if subclasses want to handle the node. Overrides should call back into this base method if they want the children of this node to be visited.
Protected methodVisitToken
Called when the walker visits a token. This method may be overridden if subclasses want to handle the token. Overrides should call back into this base method if they want the trivia of this token to be visited.
Protected methodVisitTrivia
Called when the walker visits a trivia syntax. This method may be overridden if subclasses want to handle the token. Overrides should call back into this base method if they want the children of this trivia syntax to be visited.
Top
See Also