mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Merge branch 'topic/vern/bit-ops' of https://github.com/bro/bro
* 'topic/vern/bit-ops' of https://github.com/bro/bro: documentation clarification for "p1 | p2" documentation for bitwise operators document the '|' operator for patterns test suite for bitwise operators brief NEWS blurb allow for "counter" operands (does anyone still use these?) for one (but not both) of the bitwise operands bitwise operations for "count" types implemented Starting branch for supporting bit operations on count's.
This commit is contained in:
commit
e5275b0c92
12 changed files with 215 additions and 26 deletions
31
src/Expr.h
31
src/Expr.h
|
@ -17,10 +17,13 @@ typedef enum {
|
|||
EXPR_ANY = -1,
|
||||
EXPR_NAME, EXPR_CONST,
|
||||
EXPR_CLONE,
|
||||
EXPR_INCR, EXPR_DECR, EXPR_NOT, EXPR_POSITIVE, EXPR_NEGATE,
|
||||
EXPR_INCR, EXPR_DECR,
|
||||
EXPR_NOT, EXPR_COMPLEMENT,
|
||||
EXPR_POSITIVE, EXPR_NEGATE,
|
||||
EXPR_ADD, EXPR_SUB, EXPR_ADD_TO, EXPR_REMOVE_FROM,
|
||||
EXPR_TIMES, EXPR_DIVIDE, EXPR_MOD,
|
||||
EXPR_AND, EXPR_OR,
|
||||
EXPR_AND, EXPR_OR, EXPR_XOR,
|
||||
EXPR_AND_AND, EXPR_OR_OR,
|
||||
EXPR_LT, EXPR_LE, EXPR_EQ, EXPR_NE, EXPR_GE, EXPR_GT,
|
||||
EXPR_COND,
|
||||
EXPR_REF,
|
||||
|
@ -379,6 +382,19 @@ protected:
|
|||
DECLARE_SERIAL(IncrExpr);
|
||||
};
|
||||
|
||||
class ComplementExpr : public UnaryExpr {
|
||||
public:
|
||||
explicit ComplementExpr(Expr* op);
|
||||
|
||||
protected:
|
||||
friend class Expr;
|
||||
ComplementExpr() { }
|
||||
|
||||
Val* Fold(Val* v) const override;
|
||||
|
||||
DECLARE_SERIAL(ComplementExpr);
|
||||
};
|
||||
|
||||
class NotExpr : public UnaryExpr {
|
||||
public:
|
||||
explicit NotExpr(Expr* op);
|
||||
|
@ -532,6 +548,17 @@ protected:
|
|||
DECLARE_SERIAL(BoolExpr);
|
||||
};
|
||||
|
||||
class BitExpr : public BinaryExpr {
|
||||
public:
|
||||
BitExpr(BroExprTag tag, Expr* op1, Expr* op2);
|
||||
|
||||
protected:
|
||||
friend class Expr;
|
||||
BitExpr() { }
|
||||
|
||||
DECLARE_SERIAL(BitExpr);
|
||||
};
|
||||
|
||||
class EqExpr : public BinaryExpr {
|
||||
public:
|
||||
EqExpr(BroExprTag tag, Expr* op1, Expr* op2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue