Dsxir.Predicate.AST (dsxir v0.2.0)

Copy Markdown

Parsed predicate tree.

expr is a tagged-tuple AST; source is the original predicate string the parser was given. The AST is intentionally minimal — see Dsxir.Predicate.Parser for the productions that build it.

Summary

Types

bool_expr()

@type bool_expr() :: {:and, [t_expr()]} | {:or, [t_expr()]} | {:not, t_expr()}

comp()

@type comp() :: {comp_op(), field() | length_expr(), lit() | lit_list()}

comp_op()

@type comp_op() :: :eq | :neq | :lt | :lte | :gt | :gte | :in | :not_in

field()

@type field() :: {:field, atom(), atom()} | {:program_input, atom()}

length_expr()

@type length_expr() :: {:length, field()}

lit()

@type lit() :: {:lit, term()}

lit_list()

@type lit_list() :: {:lit_list, [term()]}

t()

@type t() :: %Dsxir.Predicate.AST{expr: t_expr(), source: String.t()}

t_expr()

@type t_expr() :: comp() | bool_expr() | lit()

type()

@type type() :: :boolean | :integer | :float | :string | :atom | :any