2 * filter-visitor-ir-check-binary-op-nesting.c
4 * LTTng filter IR check binary op nesting
6 * Copyright 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 * SPDX-License-Identifier: LGPL-2.1-only
12 #include "filter-ast.hpp"
13 #include "filter-ir.hpp"
14 #include "filter-parser.hpp"
16 #include <common/compat/errno.hpp>
17 #include <common/macros.hpp>
25 static int check_bin_op_nesting_recursive(struct ir_op
*node
, int nesting
)
30 fprintf(stderr
, "[error] %s: unknown op type\n", __func__
);
34 return check_bin_op_nesting_recursive(node
->u
.root
.child
, nesting
);
38 return check_bin_op_nesting_recursive(node
->u
.unary
.child
, nesting
);
43 ret
= check_bin_op_nesting_recursive(node
->u
.binary
.left
, nesting
+ 1);
46 return check_bin_op_nesting_recursive(node
->u
.binary
.right
, nesting
+ 1);
52 ret
= check_bin_op_nesting_recursive(node
->u
.logical
.left
, nesting
);
55 return check_bin_op_nesting_recursive(node
->u
.logical
.right
, nesting
);
60 int filter_visitor_ir_check_binary_op_nesting(struct filter_parser_ctx
*ctx
)
62 return check_bin_op_nesting_recursive(ctx
->ir_root
, 0);
This page took 0.059218 seconds and 4 git commands to generate.