1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 #ifndef _GNM_EXPR_IMPL_H_
3 # define _GNM_EXPR_IMPL_H_
7 #include "parse-util.h"
12 struct _GnmExprConstant
{
14 GnmValue
const *value
;
17 struct _GnmExprFunction
{
21 GnmExprConstPtr
*argv
;
24 struct _GnmExprUnary
{
29 struct _GnmExprBinary
{
31 GnmExpr
const *value_a
;
32 GnmExpr
const *value_b
;
35 /* We could break this out into multiple types to be more space efficient */
38 Sheet
*optional_scope
;
39 Workbook
*optional_wb_scope
;
43 struct _GnmExprCellRef
{
48 struct _GnmExprArrayCorner
{
51 GnmValue
*value
; /* Last array result */
52 GnmExpr
const *expr
; /* Real Expression */
54 struct _GnmExprArrayElem
{
62 GnmExprConstPtr
*argv
;
66 GnmExprConstant constant
;
71 GnmExprCellRef cellref
;
72 GnmExprArrayCorner array_corner
;
73 GnmExprArrayElem array_elem
;
77 #define GNM_EXPR_GET_OPER(e_) (0 ? (e_) == (GnmExpr const *)0 : (GnmExprOp)*(guint8*)(e_))
79 #define gnm_expr_constant_init(expr, val) \
81 (expr)->oper = GNM_EXPR_OP_CONSTANT; \
82 (expr)->value = val; \
86 struct _GnmExprSharer
{
89 int nodes_in
, nodes_stored
, nodes_killed
;
96 #endif /* _GNM_EXPR_IMPL_H_ */