mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 20:18:20 +00:00
Implementing a VectorCoerceExpr.
Turns out we didn't have that yet. I don't remember who implemented vectors originally, but he does owe us all round at Jupiter ...
This commit is contained in:
parent
b3b5a73113
commit
5a6311d360
7 changed files with 115 additions and 6 deletions
16
src/Expr.h
16
src/Expr.h
|
@ -40,7 +40,7 @@ typedef enum {
|
|||
EXPR_CALL,
|
||||
EXPR_EVENT,
|
||||
EXPR_SCHEDULE,
|
||||
EXPR_ARITH_COERCE, EXPR_RECORD_COERCE, EXPR_TABLE_COERCE,
|
||||
EXPR_ARITH_COERCE, EXPR_RECORD_COERCE, EXPR_TABLE_COERCE, EXPR_VECTOR_COERCE,
|
||||
EXPR_SIZE,
|
||||
EXPR_FLATTEN,
|
||||
#define NUM_EXPRS (int(EXPR_FLATTEN) + 1)
|
||||
|
@ -895,6 +895,20 @@ protected:
|
|||
DECLARE_SERIAL(TableCoerceExpr);
|
||||
};
|
||||
|
||||
class VectorCoerceExpr : public UnaryExpr {
|
||||
public:
|
||||
VectorCoerceExpr(Expr* op, VectorType* v);
|
||||
~VectorCoerceExpr();
|
||||
|
||||
protected:
|
||||
friend class Expr;
|
||||
VectorCoerceExpr() { }
|
||||
|
||||
Val* Fold(Val* v) const;
|
||||
|
||||
DECLARE_SERIAL(VectorCoerceExpr);
|
||||
};
|
||||
|
||||
// An internal operator for flattening array indices that are records
|
||||
// into a list of individual values.
|
||||
class FlattenExpr : public UnaryExpr {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue