Update Spanish translation
[gnumeric.git] / src / expr-impl.h
blob59323418bc48a96661ff2b926c4ec98da2b8f71a
1 #ifndef _GNM_EXPR_IMPL_H_
2 # define _GNM_EXPR_IMPL_H_
4 #include <gnumeric.h>
5 #include <numbers.h>
6 #include <parse-util.h>
9 G_BEGIN_DECLS
11 struct _GnmExprConstant {
12 guint8 oper;
13 GnmValue const *value;
16 struct _GnmExprFunction {
17 guint8 oper;
18 int argc;
19 GnmFunc *func;
20 GnmExprConstPtr *argv;
23 struct _GnmExprUnary {
24 guint8 oper;
25 GnmExpr const *value;
28 struct _GnmExprBinary {
29 guint8 oper;
30 GnmExpr const *value_a;
31 GnmExpr const *value_b;
34 /* We could break this out into multiple types to be more space efficient */
35 struct _GnmExprName {
36 guint8 oper;
37 Sheet *optional_scope;
38 Workbook *optional_wb_scope;
39 GnmNamedExpr *name;
42 struct _GnmExprCellRef {
43 guint8 oper;
44 GnmCellRef ref;
47 struct _GnmExprArrayCorner {
48 guint8 oper;
49 guint32 cols, rows;
50 GnmValue *value; /* Last array result */
51 GnmExpr const *expr; /* Real Expression */
53 struct _GnmExprArrayElem {
54 guint8 oper;
55 guint32 x, y;
58 struct _GnmExprSet {
59 guint8 oper;
60 int argc;
61 GnmExprConstPtr *argv;
64 union _GnmExpr {
65 GnmExprConstant constant;
66 GnmExprFunction func;
67 GnmExprUnary unary;
68 GnmExprBinary binary;
69 GnmExprName name;
70 GnmExprCellRef cellref;
71 GnmExprArrayCorner array_corner;
72 GnmExprArrayElem array_elem;
73 GnmExprSet set;
76 #define GNM_EXPR_GET_OPER(e_) (0 ? (e_) == (GnmExpr const *)0 : (GnmExprOp)*(guint8*)(e_))
78 #define gnm_expr_constant_init(expr, val) \
79 do { \
80 (expr)->oper = GNM_EXPR_OP_CONSTANT; \
81 (expr)->value = val; \
82 } while (0)
85 struct _GnmExprSharer {
86 GHashTable *exprs;
88 int nodes_in, nodes_stored, nodes_killed;
89 unsigned ref_count;
93 G_END_DECLS
95 #endif /* _GNM_EXPR_IMPL_H_ */