Ast Class

Definition

The abstract base class for all PowerShell abstract syntax tree nodes.

public ref class Ast abstract
public abstract class Ast
type Ast = class
Public MustInherit Class Ast
Inheritance
Ast
Derived

Constructors

Ast(IScriptExtent)

Initialize the common fields of an ast.

Properties

Extent

The extent in the source this ast represents.

Parent

The parent tree for this node.

Methods

Copy()

Duplicates the AST, allowing it to be composed into other ASTs.

Find(Func<Ast,Boolean>, Boolean)

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

FindAll(Func<Ast,Boolean>, Boolean)

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

SafeGetValue()

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

SafeGetValue(Boolean)

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

ToString()

Formats the ast and returns a string.

Visit(AstVisitor)

Visit each node in the Ast, calling the methods in astVisitor for each node in the 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.

Applies to