public final class LexicalIslandRenderer extends Object implements RegionRenderer
Pp2OutputWriter.
Pp2TokenStream from the region's token range.LayoutContext (with those analyses + the vendor's
DialectStrategy) and run the full
LayoutRulePipeline: spacing, clause/set-operator linebreaks,
JOIN/paren/comma, CASE/AND-OR, indent/alignment, and case modification.Pp2OutputWriter.Per RegionRenderer, this returns null (so the engine falls
back to the conservative renderer) on any Throwable, or if a
TokenEquivalence content guard detects that the formatted output lost
a solid token. Content preservation and never-throw are thus upheld even if a
layout rule misbehaves — the conservative renderer remains the safety net.
Plan reference: §5.2, §7.3/S31, §7.4/S31, §10.4.
| Constructor and Description |
|---|
LexicalIslandRenderer(EDbVendor vendor) |
| Modifier and Type | Method and Description |
|---|---|
long |
getFallthroughCount() |
long |
getSuccessCount() |
RendererId |
id()
Identifier mirrored on
RendererId so
Pp2FormatResult.Region.getRendererId() reflects which strategy
actually produced the text for the region. |
String |
render(RegionParseOutcome outcome,
Pp2TokenStream stream,
Pp2FormatOptions opts)
Render the outcome's region to its final text.
|
public LexicalIslandRenderer(EDbVendor vendor)
public long getSuccessCount()
public long getFallthroughCount()
public RendererId id()
RegionRendererRendererId so
Pp2FormatResult.Region.getRendererId() reflects which strategy
actually produced the text for the region.id in interface RegionRendererpublic String render(RegionParseOutcome outcome, Pp2TokenStream stream, Pp2FormatOptions opts)
RegionRendererrender in interface RegionRendereroutcome - non-null parse outcome for the region. Implementations
may assume RegionParseOutcome.getRange() and
RegionParseOutcome.getParsedSql() are non-null.
RegionParseOutcome.getParser() is non-null only
for AST_OK
outcomes.stream - the engine's full Pp2TokenStream for the whole
input script (token-based renderers slice into it via
the outcome's range token indices)opts - non-null pp2 optionsnull (the
only sentinel) to signal fall-through to the next renderer
in the chain. An empty string is a valid rendering, not a
fall-through.