mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 20:48:21 +00:00
Expr method to invert the sense of a relational
This commit is contained in:
parent
b1e95d68e0
commit
4ee8bd0082
2 changed files with 31 additions and 0 deletions
|
@ -197,6 +197,11 @@ public:
|
|||
// the current value of expr (this is the default method).
|
||||
virtual ExprPtr MakeLvalue();
|
||||
|
||||
// Invert the sense of the operation. Returns true if the expression
|
||||
// was invertible (currently only true for relational/equality
|
||||
// expressions), false otherwise.
|
||||
virtual bool InvertSense();
|
||||
|
||||
// Marks the expression as one requiring (or at least appearing
|
||||
// with) parentheses. Used for pretty-printing.
|
||||
void MarkParen() { paren = true; }
|
||||
|
@ -791,6 +796,7 @@ public:
|
|||
ExprPtr Duplicate() override;
|
||||
bool WillTransform(Reducer* c) const override;
|
||||
ExprPtr Reduce(Reducer* c, StmtPtr& red_stmt) override;
|
||||
bool InvertSense() override;
|
||||
|
||||
protected:
|
||||
ValPtr Fold(Val* v1, Val* v2) const override;
|
||||
|
@ -805,6 +811,7 @@ public:
|
|||
ExprPtr Duplicate() override;
|
||||
bool WillTransform(Reducer* c) const override;
|
||||
ExprPtr Reduce(Reducer* c, StmtPtr& red_stmt) override;
|
||||
bool InvertSense() override;
|
||||
};
|
||||
|
||||
class CondExpr final : public Expr {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue