Skip to main content

Crate amql_predicates

Crate amql_predicates 

Source
Expand description

General-purpose expression tokenizer and predicate parser.

The public API has two layers:

  1. TokensToken enum + tokenize() produce a flat token stream from any expression string. Consumers build their own grammar on top (selectors, queries, filters, etc.).
  2. PredicatesPredicate struct + parse_predicate() parse bracket-content expressions (name op? value?).

Structs§

Predicate
A predicate expression: name, name=value, name^=value, etc.
Tokenizer
Configurable tokenizer with custom operators, keywords, and middleware.

Enums§

PredicateOp
Comparison operator.
PredicateValue
Typed predicate value.
Token
Lexical token produced by tokenize().

Functions§

eval_op
Evaluate a predicate operator against two string values.
eval_op_typed
Evaluate a predicate operator with typed values.
eval_predicate
Evaluate a predicate operator string against a node value and a predicate value.
parse_predicate
Parse a single predicate expression from bracket content.
parse_predicate_list
Parse a comma-separated list of predicates from bracket content.
tokenize
Tokenize an input string with default (built-in) operators and keywords.

Type Aliases§

AttrOp
Alias for PredicateOp (backwards compatibility).
AttrPredicate
Alias for Predicate (backwards compatibility).