diff options
author | Patrick McHardy <kaber@trash.net> | 2015-04-11 17:02:13 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2015-04-12 19:59:27 +0100 |
commit | 52532335290457cc449564b7e011f73bef3a83e2 (patch) | |
tree | 95115c2b046266442900cb1e01103b3eaf6d9167 /include | |
parent | 6aa18b5216a34a2cd29ad4a1997c37f705f76247 (diff) |
expr: add set_elem_expr as container for set element attributes
Add a new expression type "set_elem_expr" that is used as container for
the key in order to attach different attributes, such as timeout values,
to the key.
The expression hierarchy is as follows:
Sets:
elem
|
key
Maps:
mapping
/ \
elem data
|
key
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/expression.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/expression.h b/include/expression.h index 7477c3e6..d481f288 100644 --- a/include/expression.h +++ b/include/expression.h @@ -27,6 +27,7 @@ * @EXPR_LIST: list of expressions * @EXPR_SET: literal set * @EXPR_SET_REF: set reference + * @EXPR_SET_ELEM: set element * @EXPR_MAPPING: a single mapping (key : value) * @EXPR_MAP: map operation (expr map { EXPR_MAPPING, ... }) * @EXPR_UNARY: byteorder conversion, generated during evaluation @@ -48,6 +49,7 @@ enum expr_types { EXPR_LIST, EXPR_SET, EXPR_SET_REF, + EXPR_SET_ELEM, EXPR_MAPPING, EXPR_MAP, EXPR_UNARY, @@ -230,6 +232,10 @@ struct expr { struct set *set; }; struct { + /* EXPR_SET_ELEM */ + struct expr *key; + }; + struct { /* EXPR_UNARY */ struct expr *arg; }; @@ -363,6 +369,8 @@ extern struct expr *map_expr_alloc(const struct location *loc, extern struct expr *set_ref_expr_alloc(const struct location *loc, struct set *set); +extern struct expr *set_elem_expr_alloc(const struct location *loc, + struct expr *key); extern void range_expr_value_low(mpz_t rop, const struct expr *expr); extern void range_expr_value_high(mpz_t rop, const struct expr *expr); |