caffeine_query_language/ast

Types

Comparators for time slice expressions.

pub type Comparator {
  LessThan
  LessThanOrEqualTo
  GreaterThan
  GreaterThanOrEqualTo
}

Constructors

  • LessThan
  • LessThanOrEqualTo
  • GreaterThan
  • GreaterThanOrEqualTo

Marker type for parsed CQL expressions (pre-substitution).

pub type CqlParsed

An expression in the CQL AST, either an operator expression or a primary. The phantom state parameter tracks whether words have been substituted.

pub type Exp(state) {
  TimeSliceExpr(spec: TimeSliceExp)
  OperatorExpr(
    numerator: Exp(state),
    denominator: Exp(state),
    operator: Operator,
  )
  Primary(primary: Primary(state))
}

Constructors

Arithmetic operators supported in CQL expressions.

pub type Operator {
  Add
  Sub
  Mul
  Div
}

Constructors

  • Add
  • Sub
  • Mul
  • Div

A primary expression, either a word (identifier) or a parenthesized expression. The phantom state parameter mirrors the parent Exp’s state.

pub type Primary(state) {
  PrimaryWord(word: Word)
  PrimaryExp(exp: Exp(state))
}

Constructors

  • PrimaryWord(word: Word)
  • PrimaryExp(exp: Exp(state))

Marker type for substituted CQL expressions (post-substitution).

pub type Substituted

Time slice specification containing query, comparator, threshold, and interval.

pub type TimeSliceExp {
  TimeSliceExp(
    query: String,
    comparator: Comparator,
    threshold: Float,
    interval_seconds: Float,
  )
}

Constructors

  • TimeSliceExp(
      query: String,
      comparator: Comparator,
      threshold: Float,
      interval_seconds: Float,
    )

A word (identifier) in the expression.

pub type Word {
  Word(value: String)
}

Constructors

  • Word(value: String)
Search Document