Dela via


NamedBlockAst(IScriptExtent, TokenKind, StatementBlockAst, Boolean) Constructor

Definition

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

public:
 NamedBlockAst(System::Management::Automation::Language::IScriptExtent ^ extent, System::Management::Automation::Language::TokenKind blockName, System::Management::Automation::Language::StatementBlockAst ^ statementBlock, bool unnamed);
public NamedBlockAst (System.Management.Automation.Language.IScriptExtent extent, System.Management.Automation.Language.TokenKind blockName, System.Management.Automation.Language.StatementBlockAst statementBlock, bool unnamed);
new System.Management.Automation.Language.NamedBlockAst : System.Management.Automation.Language.IScriptExtent * System.Management.Automation.Language.TokenKind * System.Management.Automation.Language.StatementBlockAst * bool -> System.Management.Automation.Language.NamedBlockAst
Public Sub New (extent As IScriptExtent, blockName As TokenKind, statementBlock As StatementBlockAst, unnamed As Boolean)

Parameters

extent
IScriptExtent

The extent of the block. If unnamed is false, the extent includes the keyword through the closing curly, otherwise the extent is the as the extent of statementBlock.

blockName
TokenKind

The kind of block, must be one of:

statementBlock
StatementBlockAst

The ast for the statements in this named block.

unnamed
Boolean

True if the block was not explicitly named.

Exceptions

If extent or statementBlock is null.

If blockName is not one of the valid kinds for a named block, or if unnamed is true and blockName is neither Process nor End.

Applies to