Search Results for

    Show / Hide Table of Contents

    Class SyntaxWalker

    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
    System.Object
    SyntaxWalker
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Loretta.CodeAnalysis
    Assembly: Loretta.CodeAnalysis.dll
    Syntax
    public abstract class SyntaxWalker

    Constructors

    | Improve this Doc View Source

    SyntaxWalker(SyntaxWalkerDepth)

    Creates a new walker instance.

    Declaration
    protected SyntaxWalker(SyntaxWalkerDepth depth = SyntaxWalkerDepth.Node)
    Parameters
    Type Name Description
    SyntaxWalkerDepth depth

    Syntax the SyntaxWalker should descend into.

    Properties

    | Improve this Doc View Source

    Depth

    Syntax the SyntaxWalker should descend into.

    Declaration
    protected SyntaxWalkerDepth Depth { get; }
    Property Value
    Type Description
    SyntaxWalkerDepth

    Methods

    | Improve this Doc View Source

    Visit(SyntaxNode)

    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.

    Declaration
    public virtual void Visit(SyntaxNode node)
    Parameters
    Type Name Description
    SyntaxNode node

    The current node that the walker is visiting.

    | Improve this Doc View Source

    VisitToken(SyntaxToken)

    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.

    Declaration
    protected virtual void VisitToken(SyntaxToken token)
    Parameters
    Type Name Description
    SyntaxToken token

    The current token that the walker is visiting.

    | Improve this Doc View Source

    VisitTrivia(SyntaxTrivia)

    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.

    Declaration
    protected virtual void VisitTrivia(SyntaxTrivia trivia)
    Parameters
    Type Name Description
    SyntaxTrivia trivia

    The current trivia syntax that the walker is visiting.

    • Improve this Doc
    • View Source
    ☀
    ☾
    In This Article
    Back to top

    Copyright (c) LorettaDevs

    Generated by DocFX

    ☀
    ☾