NamedBlockAst Class

Definition

The ast representing a begin, process, end, or dynamicparam block in a scriptblock. This ast is used even when the block is unnamed, in which case the block is either an end block (for functions) or process block (for filters).

public ref class NamedBlockAst : System::Management::Automation::Language::Ast
public class NamedBlockAst : System.Management.Automation.Language.Ast
type NamedBlockAst = class
    inherit Ast
Public Class NamedBlockAst
Inherits Ast
Inheritance
NamedBlockAst

Constructors

NamedBlockAst(IScriptExtent, TokenKind, StatementBlockAst, Boolean)

Construct the ast for a begin, process, end, or dynamic param block.

Properties

BlockKind

The kind of block, always one of:

Extent

The extent in the source this ast represents.

(Inherited from Ast)
Parent

The parent tree for this node.

(Inherited from Ast)
Statements

The asts for all of the statements represented by this statement block. This property is never null.

Traps

The asts for all of the trap statements specified by this statement block, or null if no trap statements were specified in this block.

Unnamed

For a function/filter that did not explicitly name the end/process block (which is quite common), this property will return true.

Methods

Copy()

Copy the NamedBlockAst instance

Find(Func<Ast,Boolean>, Boolean)

Traverse the entire Ast, returning the first node in the tree for which predicate returns true.

(Inherited from Ast)
FindAll(Func<Ast,Boolean>, Boolean)

Traverse the entire Ast, returning all nodes in the tree for which predicate returns true.

(Inherited from Ast)
SafeGetValue()

Constructs the resultant object from the AST and returns it if it is safe.

(Inherited from Ast)
ToString()

Formats the ast and returns a string.

(Inherited from Ast)
Visit(AstVisitor)

Visit each node in the Ast, calling the methods in astVisitor for each node in the ast.

(Inherited from Ast)
Visit(ICustomAstVisitor)

Visit the Ast using a visitor that can choose how the tree traversal is performed. This visit method is for advanced uses of the visitor pattern where an AstVisitor is insufficient.

(Inherited from Ast)

Applies to