001package gudusoft.gsqlparser.pp2.island;
002
003/**
004 * The clause a token belongs to within its SQL query block, as computed by
005 * {@link ClauseScopeAnnotator}. Each token belongs to exactly one clause part
006 * (within its SQL scope level).
007 *
008 * <p>Plan reference: §7.3/S21, §7.4/S21.
009 */
010public enum ClausePart {
011
012    /** Not inside a recognised clause (e.g. between statements, or a bare master target). */
013    NONE,
014
015    /** SELECT projection list (between {@code SELECT} and {@code FROM}). */
016    SELECT_LIST,
017
018    /** {@code INTO} target (INSERT INTO / SELECT INTO). */
019    INTO,
020
021    /** {@code FROM} clause table list (before any JOIN). */
022    FROM,
023
024    /** JOIN clause: {@code JOIN}/{@code ON}/{@code USING}/{@code APPLY} and operands. */
025    JOIN,
026
027    /** {@code WHERE} predicate. */
028    WHERE,
029
030    /** {@code GROUP BY} list. */
031    GROUP_BY,
032
033    /** {@code HAVING} predicate. */
034    HAVING,
035
036    /** {@code ORDER BY} list. */
037    ORDER_BY,
038
039    /** Set operator and its tail ({@code UNION}/{@code INTERSECT}/{@code EXCEPT}/{@code MINUS}/{@code ALL}). */
040    SET_OP,
041
042    /** {@code SET} assignment list of an UPDATE. */
043    UPDATE_SET,
044
045    /** {@code VALUES} list of an INSERT. */
046    INSERT_VALUES
047}