39ac76c4174c53beca08bd21cd126a3298e66726
[lttng-tools.git] / src / lib / lttng-ctl / filter-ir.h
1 #ifndef _FILTER_IR_H
2 #define _FILTER_IR_H
3
4 /*
5 * filter-ir.h
6 *
7 * LTTng filter ir
8 *
9 * Copyright 2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 *
11 * This library is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License, version 2.1 only,
13 * as published by the Free Software Foundation.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this library; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24
25 #include "filter-ast.h"
26
27 enum ir_op_signedness {
28 IR_SIGN_UNKNOWN = 0,
29 IR_SIGNED,
30 IR_UNSIGNED,
31 IR_SIGN_DYN, /* signedness determined dynamically */
32 };
33
34 enum ir_data_type {
35 IR_DATA_UNKNOWN = 0,
36 IR_DATA_STRING,
37 IR_DATA_NUMERIC, /* numeric and boolean */
38 IR_DATA_FLOAT,
39 IR_DATA_FIELD_REF,
40 };
41
42 enum ir_op_type {
43 IR_OP_UNKNOWN = 0,
44 IR_OP_ROOT,
45 IR_OP_LOAD,
46 IR_OP_UNARY,
47 IR_OP_BINARY,
48 IR_OP_LOGICAL,
49 };
50
51 /* left or right child */
52 enum ir_side {
53 IR_SIDE_UNKNOWN = 0,
54 IR_LEFT,
55 IR_RIGHT,
56 };
57
58 struct ir_op_root {
59 struct ir_op *child;
60 };
61
62 struct ir_op_load {
63 union {
64 char *string;
65 int64_t num;
66 double flt;
67 char *ref;
68 } u;
69 };
70
71 struct ir_op_unary {
72 enum unary_op_type type;
73 struct ir_op *child;
74 };
75
76 struct ir_op_binary {
77 enum op_type type;
78 struct ir_op *left;
79 struct ir_op *right;
80 };
81
82 struct ir_op_logical {
83 enum op_type type;
84 struct ir_op *left;
85 struct ir_op *right;
86 };
87
88 struct ir_op {
89 /* common to all ops */
90 enum ir_op_type op;
91 enum ir_data_type data_type;
92 enum ir_op_signedness signedness;
93 enum ir_side side;
94
95 union {
96 struct ir_op_root root;
97 struct ir_op_load load;
98 struct ir_op_unary unary;
99 struct ir_op_binary binary;
100 struct ir_op_logical logical;
101 } u;
102 };
103
104 #endif /* _FILTER_IR_H */
This page took 0.030621 seconds and 3 git commands to generate.