From 72931553828af0ce85f0562b9ff8ec7f4d28e050 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 8 Feb 2019 17:02:22 +0100 Subject: src: expr: add expression etype Temporary kludge to remove all the expr->ops->type == ... patterns. Followup patch will remove expr->ops, and make expr_ops() lookup the correct expr_ops struct instead to reduce struct expr size. Signed-off-by: Florian Westphal --- src/parser_bison.y | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index 02a373cb..0f4d2df8 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -1807,7 +1807,7 @@ data_type_atom_expr : type_identifier data_type_expr : data_type_atom_expr | data_type_expr DOT data_type_atom_expr { - if ($1->ops->type != EXPR_CONCAT) { + if ($1->etype != EXPR_CONCAT) { $$ = concat_expr_alloc(&@$); compound_expr_add($$, $1); } else { @@ -2741,7 +2741,7 @@ basic_stmt_expr : inclusive_or_stmt_expr concat_stmt_expr : basic_stmt_expr | concat_stmt_expr DOT primary_stmt_expr { - if ($$->ops->type != EXPR_CONCAT) { + if ($$->etype != EXPR_CONCAT) { $$ = concat_expr_alloc(&@$); compound_expr_add($$, $1); } else { @@ -3252,7 +3252,7 @@ basic_expr : inclusive_or_expr concat_expr : basic_expr | concat_expr DOT basic_expr { - if ($$->ops->type != EXPR_CONCAT) { + if ($$->etype != EXPR_CONCAT) { $$ = concat_expr_alloc(&@$); compound_expr_add($$, $1); } else { @@ -3650,7 +3650,7 @@ basic_rhs_expr : inclusive_or_rhs_expr concat_rhs_expr : basic_rhs_expr | concat_rhs_expr DOT basic_rhs_expr { - if ($$->ops->type != EXPR_CONCAT) { + if ($$->etype != EXPR_CONCAT) { $$ = concat_expr_alloc(&@$); compound_expr_add($$, $1); } else { @@ -4141,7 +4141,7 @@ ct_stmt : CT ct_key SET stmt_expr payload_stmt : payload_expr SET stmt_expr { - if ($1->ops->type == EXPR_EXTHDR) + if ($1->etype == EXPR_EXTHDR) $$ = exthdr_stmt_alloc(&@$, $1, $3); else $$ = payload_stmt_alloc(&@$, $1, $3); -- cgit v1.2.3