public final class RenderedRegion extends Object
StatementRange and the text a
RegionRenderer produced for that range.
Created by Pp2Engine (S16) after dispatching each region to the
appropriate renderer, and consumed by RegionAssembler (S15) which
interleaves the rendered texts with the original inter-region trivia.
Every RegionRenderer implementation omits the leading whitespace
for the first token of its range — the bytes that sit in the
original source between the previous region's end and this region's first
token. The RegionAssembler is the counterparty: it fills those gaps
verbatim from SourceSpanLedger.getSource().
Plan reference: §10.4 (engine dispatch loop), §7.3/S15, §7.3/S16.
| Constructor and Description |
|---|
RenderedRegion(StatementRange range,
String text,
RendererId rendererId) |
| Modifier and Type | Method and Description |
|---|---|
StatementRange |
getRange()
The statement boundary this rendering covers.
|
RendererId |
getRendererId()
Which renderer produced this text.
|
String |
getText()
The rendered output text.
|
String |
toString() |
public RenderedRegion(StatementRange range, String text, RendererId rendererId)
range - the statement boundary covering this rendering;
StatementRange.getStartOffset() and
StatementRange.getEndOffset() are the byte
coordinates the assembler reads to locate inter-region
triviatext - the rendered output; "" is valid for an empty
region; must not be nullrendererId - which renderer produced text; non-nullpublic StatementRange getRange()
public String getText()
"" for
a legitimately empty region.public RendererId getRendererId()