Ast Ast Ast Class


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

public abstract class Ast
type Ast = class
Public MustInherit Class Ast


Ast(IScriptExtent) Ast(IScriptExtent) Ast(IScriptExtent)

Initialize the common fields of an ast.


Extent Extent Extent

The extent in the source this ast represents.

Parent Parent Parent

The parent tree for this node.


Copy() Copy() Copy()

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

Find(Func<Ast,Boolean>, Boolean) Find(Func<Ast,Boolean>, Boolean) 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) FindAll(Func<Ast,Boolean>, Boolean) FindAll(Func<Ast,Boolean>, Boolean)

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

SafeGetValue() SafeGetValue() SafeGetValue()

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

ToString() ToString() ToString()

Formats the ast and returns a string.

Visit(AstVisitor) Visit(AstVisitor) Visit(AstVisitor)

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

Visit(ICustomAstVisitor) Visit(ICustomAstVisitor) 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