Rosetta.AST.Utilities.MultiPurposeASTWalker.MultiPurposeASTWalker C# (CSharp) Method

MultiPurposeASTWalker() public method

Initializes a new instance of the MultiPurposeASTWalker class.
The walker will walk through all nodes as depth level.
public MultiPurposeASTWalker ( Microsoft.CodeAnalysis.SyntaxNode node, bool>.Func condition, Action operation, bool traverseRootOnly = false ) : System
node Microsoft.CodeAnalysis.SyntaxNode The root to traverse.
condition bool>.Func The condition to react to when traversing nodes.
operation Action The operation to perform when condition is met when traversing a node.
traverseRootOnly bool /// When true, it causes the walker to traverse only the units in , /// otherwise a full deep traversal is performed. ///
return System
        public MultiPurposeASTWalker(SyntaxNode node, Func<SyntaxNode, bool> condition, Action<SyntaxNode> operation, bool traverseRootOnly = false)
            : base(SyntaxWalkerDepth.Node)
        {
            if (node == null)
            {
                throw new ArgumentNullException(nameof(node));
            }
            if (condition == null)
            {
                throw new ArgumentNullException(nameof(condition));
            }
            if (operation == null)
            {
                throw new ArgumentNullException(nameof(operation));
            }

            this.root = node;
            this.condition = condition;
            this.operation = operation;
            this.traverseRootOnly = traverseRootOnly;
        }
MultiPurposeASTWalker