Open sandboxFocus
  • Article

Class StatementBuilder

Allows to build a run-time statement that can be injected to run-time code using ToStatement() and InsertStatement(IStatement).

Inheritance
StatementBuilder
Implements
Namespace: Metalama.Framework.Code.SyntaxBuilders
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public sealed class StatementBuilder : SyntaxBuilder, IStatementBuilder

Constructors

Name Description
StatementBuilder()

Methods

Name Description
AppendLine()

Appends a line break.

AppendVerbatim(string)

Appends a string to the StringBuilder, without performing any modification to the input string.

BeginBlock()

Begins a block (appends a { and increments the indentation level).

Clone()

Returns a clone of the current StatementBuilder.

EndBlock()

Ends a block (appends a } and decrements the indentation level).

Indent()

Increments the indentation level.

ToStatement()

Converts the current StatementBuilder into an IStatement object, which can then be inserted into run-time code using the InsertStatement(IStatement) method.

Unindent()

Decrements the indentation level.

Extension Methods