Class ConditionGrammar
java.lang.Object
ai.badmonkey.agentspaces.constraints.ConditionGrammar
The condition grammar (ISSUE-Constraints FR-5, ยง9.2): a
FieldFilter guard over one type's fields and
tags plus four key-level predicates, joined by and, or, not, with parentheses.
condition := term (("and" | "or") term)* | "not" term | "(" condition ")"
term := "exists(" T guard? ")" | "count(" T guard? ")" op integer | "newest(" T ")." field op literal
| "age(" T ")" ">" duration
guard := "where" clause ("," clause)*
Parsing is total: malformed text is refused with the text in the message.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordstatic interfaceA parsed condition, evaluated over one key's events at a moment.static final recordstatic final recordstatic final recordstatic final recordstatic final record -
Method Summary
Modifier and TypeMethodDescriptionEvaluates every named condition of a vocabulary; a condition that fails to parse evaluates to false.static ConditionGrammar.ConditionParses one condition; the message of a refusal carries the text.
-
Method Details
-
parse
Parses one condition; the message of a refusal carries the text. -
evaluateAll
-