001package gudusoft.gsqlparser.pp2;
002
003/**
004 * Identifies which strategy produced a given output region — in practice,
005 * <b>whether pp formatted that part of the input or pp2 had to</b>.
006 *
007 * <p>Created here in S3 (not S16) because {@link Pp2FormatResult.Region} carries
008 * one; S16 simply populates the dispatch values.
009 *
010 * <ul>
011 *   <li>{@link #GUARDED_AST} — <b>pp formatted this region.</b> The text is
012 *       {@code FormatterFactory.pp()}'s own output, taken unchanged after it
013 *       passed the {@code TokenEquivalence} guard. Reached either by the
014 *       whole-document fast path or, per region, via
015 *       {@code GuardedAstDelegate} (S13). Any region the input parses cleanly
016 *       in should land here.</li>
017 *   <li>{@link #LEXICAL_ISLAND} — pp could not be used here (the region did
018 *       not parse, pp threw, or pp's output failed the guard), so
019 *       {@code LexicalIslandRenderer} (S31) laid it out from the token stream
020 *       alone. Layout is plainer than pp's, but no token is lost.</li>
021 *   <li>{@link #CONSERVATIVE} — last resort:
022 *       {@code ConservativeTokenRenderer} (S14), a single-space token
023 *       passthrough. Used when the island renderer also declined.</li>
024 *   <li>{@link #AST_OVERLAY} — {@code AstOverlayRenderer} (v3, not in v2). The
025 *       enum value exists so v3 can light it up without an API change.</li>
026 * </ul>
027 *
028 * <p>A result whose regions are all {@code GUARDED_AST} is pp output end to
029 * end; the other values pinpoint the byte ranges pp could not reach.
030 */
031public enum RendererId {
032    GUARDED_AST,
033    CONSERVATIVE,
034    LEXICAL_ISLAND,
035    AST_OVERLAY
036}