pub enum Op {
Load {
path: ObjectPath,
},
Compare {
operator: ComparisonOperator,
negated: bool,
lhs: InstrId,
rhs: Operand,
},
And {
lhs: InstrId,
rhs: InstrId,
},
Or {
lhs: InstrId,
rhs: InstrId,
},
Yield {
value: InstrId,
},
Observe {
block: BlockId,
},
FollowedBy {
lhs: InstrId,
rhs: InstrId,
},
Within {
input: InstrId,
seconds: f64,
},
Repeats {
input: InstrId,
count: u64,
},
StartStop {
input: InstrId,
start: String,
stop: String,
},
Ret {
value: InstrId,
},
}Expand description
One three-address operation.
Instructions in a BlockKind::Comparison block use the comparison-tier ops
(Load, Compare, And, Or, Yield); instructions in the
BlockKind::Main block use the observation-tier ops. And and Or are
shared between the tiers and take their evaluation semantics from the
enclosing block’s kind.
Variants§
Load
Resolve an object path to a value.
Fields
path: ObjectPathThe path to resolve.
Compare
Apply a comparison operator to a loaded value and an operand.
Fields
operator: ComparisonOperatorThe comparison operator.
And
Boolean conjunction of two values.
Or
Boolean disjunction of two values.
Yield
Terminator of a comparison block: its result.
Observe
Evaluate a comparison block against an observation.
FollowedBy
FOLLOWEDBY: the left result’s observations precede the right’s.
Within
WITHIN <seconds> SECONDS applied to a result.
Repeats
REPEATS <count> TIMES applied to a result.
StartStop
START <start> STOP <stop> applied to a result.
Fields
Ret
Terminator of the main block: the program’s result.