Class PiecewiseSourceDocumentBuilder

Namespace
Pixie.Code
Assembly
Pixie.dll

Builds a PiecewiseSourceDocument incrementally.

public sealed class PiecewiseSourceDocumentBuilder
Inheritance
PiecewiseSourceDocumentBuilder
Inherited Members

Constructors

PiecewiseSourceDocumentBuilder(string)

Creates a piecewise source document builder.

public PiecewiseSourceDocumentBuilder(string identifier)

Parameters

identifier string

The identifier for the assembled document.

Methods

AddSource(SourceSpan)

Adds a source-backed piece to the assembled document.

public PiecewiseSourceDocumentBuilder AddSource(SourceSpan origin)

Parameters

origin SourceSpan

The source span to copy into the assembled document.

Returns

PiecewiseSourceDocumentBuilder

This builder.

AddText(string)

Adds generated text with no known source provenance.

public PiecewiseSourceDocumentBuilder AddText(string text)

Parameters

text string

The generated text.

Returns

PiecewiseSourceDocumentBuilder

This builder.

AddText(string, SourceSpan)

Adds generated text anchored to a source span for diagnostics.

public PiecewiseSourceDocumentBuilder AddText(string text, SourceSpan anchor)

Parameters

text string

The generated text.

anchor SourceSpan

The source span that caused the generated text to exist.

Returns

PiecewiseSourceDocumentBuilder

This builder.

Build()

Creates a piecewise source document from the pieces added so far.

public PiecewiseSourceDocument Build()

Returns

PiecewiseSourceDocument

A piecewise source document.