public interface LayoutRule
LayoutContext (token stream +
upstream analyses + decisions so far) and request layout decisions
(requestLinebreaksBefore/requestBlanksBefore/requestIndent).
Rules are registered with a LayoutRulePipeline and applied in
registration order. Competing writes to the same token-gap property are
resolved by priority() (higher wins; later-applied wins on a tie) via
the LayoutConflictResolver.
Implementations must be iterative (no recursion over deep trees) and must
not mutate Pp2Token or the wrapped
TSourceToken; all output goes through the context's request methods.
Plan reference: §7.3/S23, §7.4/S23.
| Modifier and Type | Method and Description |
|---|---|
void |
apply(LayoutContext context)
Apply the rule, requesting layout decisions on the context.
|
String |
name()
Short, stable identifier for logging/diagnostics.
|
int |
priority()
The rule's precedence.
|
int priority()
void apply(LayoutContext context)