Open sandboxFocus

Class StatementListBuilder

Allows building lists of statements programmatically by adding IStatement objects one at a time.

Inheritance
StatementListBuilder
Namespace: Metalama.Framework.Code.SyntaxBuilders
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public class StatementListBuilder
Remarks

StatementListBuilder provides a way to dynamically construct a list of statements when the number or content of statements is determined at compile time. Use Add(IStatement) to add individual statements or Add(IStatementList) to add entire statement lists. After adding all statements, call ToStatementList() to get an IStatementList that can be used with other builders like SwitchStatementBuilder or with Block(IStatementList).

Constructors

Name Description
StatementListBuilder()

Methods

Name Description
Add(IStatement)

Appends an IStatement to the list.

Add(IStatementList)

Appends an IStatementList to the list.

ToStatementList()

Creates an IStatementList from the current object.

Extension Methods

See Also