1 #ifndef _GNM_EXPR_IMPL_H_
2 # define _GNM_EXPR_IMPL_H_
6 #include <parse-util.h>
11 struct _GnmExprConstant
{
13 GnmValue
const *value
;
16 struct _GnmExprFunction
{
20 GnmExprConstPtr
*argv
;
23 struct _GnmExprUnary
{
28 struct _GnmExprBinary
{
30 GnmExpr
const *value_a
;
31 GnmExpr
const *value_b
;
34 /* We could break this out into multiple types to be more space efficient */
37 Sheet
*optional_scope
;
38 Workbook
*optional_wb_scope
;
42 struct _GnmExprCellRef
{
47 struct _GnmExprArrayCorner
{
50 GnmValue
*value
; /* Last array result */
51 GnmExpr
const *expr
; /* Real Expression */
53 struct _GnmExprArrayElem
{
61 GnmExprConstPtr
*argv
;
65 GnmExprConstant constant
;
70 GnmExprCellRef cellref
;
71 GnmExprArrayCorner array_corner
;
72 GnmExprArrayElem array_elem
;
76 #define GNM_EXPR_GET_OPER(e_) (0 ? (e_) == (GnmExpr const *)0 : (GnmExprOp)*(guint8*)(e_))
78 #define gnm_expr_constant_init(expr, val) \
80 (expr)->oper = GNM_EXPR_OP_CONSTANT; \
81 (expr)->value = val; \
85 struct _GnmExprSharer
{
88 int nodes_in
, nodes_stored
, nodes_killed
;
95 #endif /* _GNM_EXPR_IMPL_H_ */