"""KDL-based loader for .loop and .vertex files."""

from .ast import (
    Boundary,
    BoundaryAfter,
    BoundaryCondition,
    BoundaryEvery,
    BoundaryWhen,
    Coerce,
    CombineEntry,
    Duration,
    Explode,
    Flatten,
    FoldAvg,
    FoldBy,
    FoldCollect,
    FoldCount,
    FoldDecl,
    FoldLatest,
    FoldMax,
    FoldMin,
    FoldOp,
    FoldSum,
    FoldWindow,
    FromFile,
    FromSource,
    GrantDecl,
    InlineSource,
    LensDecl,
    LoopDef,
    LoopFile,
    LStrip,
    ObserverDecl,
    ParseStep,
    Pick,
    Project,
    Replace,
    RStrip,
    Skip,
    SourceEntry,
    SourceParams,
    SourcesBlock,
    Split,
    Strip,
    TemplateSource,
    Transform,
    TransformOp,
    Trigger,
    VertexFile,
    Where,
)
from .errors import DSLError, LexError, Location, ParseError, ValidationError
from .loader import parse_loop, parse_loop_file, parse_vertex, parse_vertex_file
from .population import (
    PopulationInfo,
    PopulationRow,
    read_population,
    resolve_template,
    resolve_vertex,
    template_name,
)
from .validator import validate, validate_loop, validate_vertex

__all__ = [
    # AST types - Loop file
    "LoopFile",
    "Duration",
    "ParseStep",
    "Skip",
    "Split",
    "Pick",
    "Transform",
    "TransformOp",
    "Strip",
    "LStrip",
    "RStrip",
    "Replace",
    "Coerce",
    "Trigger",
    "Explode",
    "Project",
    "Where",
    "Flatten",
    # AST types - Vertex file
    "VertexFile",
    "LoopDef",
    "FoldDecl",
    "FoldOp",
    "FoldAvg",
    "FoldBy",
    "FoldCollect",
    "FoldCount",
    "FoldLatest",
    "FoldMax",
    "FoldMin",
    "FoldSum",
    "FoldWindow",
    "Boundary",
    "BoundaryAfter",
    "BoundaryCondition",
    "BoundaryEvery",
    "BoundaryWhen",
    # AST types - Combinatorial vertices
    "CombineEntry",
    # AST types - Lens declarations
    "LensDecl",
    # AST types - Observer declarations
    "ObserverDecl",
    "GrantDecl",
    # AST types - Inline sources / sources blocks
    "InlineSource",
    "SourcesBlock",
    # AST types - Template sources
    "SourceEntry",
    "SourceParams",
    "TemplateSource",
    "FromFile",
    "FromSource",
    # Parser (KDL loader)
    "parse_loop",
    "parse_loop_file",
    "parse_vertex",
    "parse_vertex_file",
    # Errors
    "DSLError",
    "LexError",
    "ParseError",
    "ValidationError",
    "Location",
    # Population management
    "PopulationRow",
    "PopulationInfo",
    "resolve_vertex",
    "resolve_template",
    "template_name",
    "read_population",
    # Validator
    "validate",
    "validate_loop",
    "validate_vertex",
]
