Commit 0ac8fbbf authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Massive rename ExprTree -> GnmExpr


2002-03-21  Jody Goldberg <jody@gnome.org>

	* Massive rename
	ExprTree -> GnmExpr

	* src/print-info.c (load_formats) : suppress some warnings.

	* src/func.c (function_def_call_with_values) : use g_alloca.
parent 40321865
2002-03-21 Jody Goldberg <jody@gnome.org>
* Massive rename
ExprTree -> GnmExpr
* src/print-info.c (load_formats) : suppress some warnings.
* src/func.c (function_def_call_with_values) : use g_alloca.
2002-03-21 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* AUTHORS: Added the authors of the LP Solve algorithm.
2002-03-20 Jody Goldberg <jody@gnome.org>
* src/sheet-style.c (cell_tile_apply_pos) : a simple optimization.
Don't split a tile to apply the existing style.
* src/cellspan.c (cell_calc_span) : Fix span calc when spanning
through hidden columns with content there was a typo, and a logic
error. No need to change the margin for an invisible column.
......
......@@ -19,6 +19,7 @@ Jody:
* Improve event handling during sheet-object editing.
* Add dependency support for 3d references. needs work on delete.
* More polish to dependency engine.
* Big ExprTree -> GnmExpr rename in prep for libgnumeric.
Jukka:
* More solver improvements.
......
2002-03-21 Jody Goldberg <jody@gnome.org>
* Massive rename
ExprTree -> GnmExpr
* src/print-info.c (load_formats) : suppress some warnings.
* src/func.c (function_def_call_with_values) : use g_alloca.
2002-03-21 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* AUTHORS: Added the authors of the LP Solve algorithm.
2002-03-20 Jody Goldberg <jody@gnome.org>
* src/sheet-style.c (cell_tile_apply_pos) : a simple optimization.
Don't split a tile to apply the existing style.
* src/cellspan.c (cell_calc_span) : Fix span calc when spanning
through hidden columns with content there was a typo, and a logic
error. No need to change the margin for an invisible column.
......
2002-03-21 Jody Goldberg <jody@gnome.org>
* Massive rename
ExprTree -> GnmExpr
* src/print-info.c (load_formats) : suppress some warnings.
* src/func.c (function_def_call_with_values) : use g_alloca.
2002-03-21 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* AUTHORS: Added the authors of the LP Solve algorithm.
2002-03-20 Jody Goldberg <jody@gnome.org>
* src/sheet-style.c (cell_tile_apply_pos) : a simple optimization.
Don't split a tile to apply the existing style.
* src/cellspan.c (cell_calc_span) : Fix span calc when spanning
through hidden columns with content there was a typo, and a logic
error. No need to change the margin for an invisible column.
......
......@@ -967,7 +967,7 @@ applix_read_cells (ApplixReadState *state)
case ';' : /* First of a shared formula */
case '.' : { /* instance of a shared formula */
ParsePos pos;
ExprTree *expr;
GnmExpr const *expr;
Value *val = NULL;
Range r;
char *expr_string;
......@@ -1025,10 +1025,10 @@ applix_read_cells (ApplixReadState *state)
continue;
}
expr = expr_parse_str (expr_string+1,
expr = gnm_expr_parse_str (expr_string+1,
parse_pos_init_cell (&pos, cell),
GNM_PARSER_USE_APPLIX_REFERENCE_CONVENTIONS |
GNM_PARSER_CREATE_PLACEHOLDER_FOR_UNKNOWN_FUNC,
GNM_EXPR_PARSE_USE_APPLIX_REFERENCE_CONVENTIONS |
GNM_EXPR_PARSE_CREATE_PLACEHOLDER_FOR_UNKNOWN_FUNC,
NULL);
if (expr == NULL) {
(void) applix_parse_error (state, "Invalid expression");
......@@ -1036,7 +1036,7 @@ applix_read_cells (ApplixReadState *state)
}
if (is_array) {
expr_tree_ref (expr);
gnm_expr_ref (expr);
cell_set_array_formula (sheet,
r.start.col, r.start.row,
r.end.col, r.end.row,
......@@ -1056,7 +1056,8 @@ applix_read_cells (ApplixReadState *state)
*tmp = '\0';
/* Store the newly parsed expresion along with its descriptor */
g_hash_table_insert (state->exprs, g_strdup (ptr), expr);
g_hash_table_insert (state->exprs, g_strdup (ptr),
(gpointer)expr);
} else {
#if 0
printf ("shared '%s'\n", expr_string);
......@@ -1290,7 +1291,7 @@ static gboolean
cb_remove_expr (gpointer key, gpointer value, gpointer user_data)
{
g_free (key);
expr_tree_unref (value);
gnm_expr_unref (value);
return TRUE;
}
static gboolean
......
2002-03-20 Jody Goldberg <jody@gnome.org>
* ms-excel-read.c (ms_excel_read_sheet) : 15 is the
default fmt for cells. 0 is the default style fmt that is its
parent.
(ms_excel_set_xf) : not strictly correct. We should apply if the col,
row is different.
(ms_excel_set_xf_segment) : no need to apply if it is the default.
2002-03-18 Morten Welinder <terra@diku.dk>
* ms-excel-read.h (_ExcelWorkbook): Add sharer.
......
......@@ -336,8 +336,8 @@ BC_R(ai)(ExcelChartHandler const *handle,
/* (2) == linked to container */
if (ref_type == 2) {
ExprTree *expr = ms_container_parse_expr (s->parent,
q->data+8, length);
GnmExpr const *expr = ms_container_parse_expr (s->parent,
q->data+8, length);
if (expr) {
Sheet *sheet = ms_container_sheet (s->parent);
......@@ -1832,7 +1832,7 @@ BC_R(seriestext)(ExcelChartHandler const *handle,
s->currentSeries->vector [MS_VECTOR_PURPOSE_LABELS].remote_ID =
gnm_graph_add_vector (s->graph,
expr_tree_new_constant (value_new_string (str)),
gnm_expr_new_constant (value_new_string (str)),
GNM_VECTOR_STRING,
ms_container_sheet (s->parent));
#endif
......@@ -2364,7 +2364,7 @@ chart_create_obj (MSContainer *container, MSObj *obj)
return NULL;
}
static ExprTree *
static GnmExpr const *
chart_parse_expr (MSContainer *container, guint8 const *data, int length)
{
return NULL;
......
......@@ -124,7 +124,7 @@ ms_container_realize_objs (MSContainer *container)
*
* Attempts to parse the encoded expression in the context of the container.
*/
ExprTree *
GnmExpr const *
ms_container_parse_expr (MSContainer *c, guint8 const *data, int length)
{
g_return_val_if_fail (c != NULL, NULL);
......
......@@ -10,12 +10,12 @@ typedef struct _MSObj MSObj;
typedef struct
{
gboolean (*realize_obj) (MSContainer *container, MSObj *obj);
GObject * (*create_obj) (MSContainer *container, MSObj *obj);
ExprTree * (*parse_expr) (MSContainer *container,
guint8 const *data, int length);
Sheet * (*sheet) (MSContainer const *container);
StyleFormat * (*get_fmt) (MSContainer const *container, guint16 indx);
gboolean (*realize_obj) (MSContainer *container, MSObj *obj);
GObject * (*create_obj) (MSContainer *container, MSObj *obj);
GnmExpr const * (*parse_expr) (MSContainer *container,
guint8 const *data, int length);
Sheet * (*sheet) (MSContainer const *container);
StyleFormat * (*get_fmt) (MSContainer const *container, guint16 indx);
} MSContainerClass;
struct _MSContainer
......@@ -40,7 +40,7 @@ MSEscherBlip *ms_container_get_blip (MSContainer *c, int blip_id);
void ms_container_set_blips (MSContainer *c, GPtrArray *blips);
void ms_container_add_obj (MSContainer *c, MSObj *obj);
void ms_container_realize_objs (MSContainer *c);
ExprTree *ms_container_parse_expr (MSContainer *c,
GnmExpr const *ms_container_parse_expr (MSContainer *c,
guint8 const *data, int length);
Sheet *ms_container_sheet (MSContainer const *c);
StyleFormat *ms_container_get_fmt (MSContainer const *container, guint16 indx);
......
......@@ -127,10 +127,10 @@ ms_excel_wb_get_fmt (ExcelWorkbook *wb, guint16 idx)
return NULL;
}
static ExprTree *
static GnmExpr const *
ms_sheet_parse_expr_internal (ExcelSheet *esheet, guint8 const *data, int length)
{
ExprTree *expr;
GnmExpr const *expr;
g_return_val_if_fail (length > 0, NULL);
......@@ -143,7 +143,7 @@ ms_sheet_parse_expr_internal (ExcelSheet *esheet, guint8 const *data, int length
Sheet *sheet = esheet->gnum_sheet;
Workbook *wb = (sheet == NULL) ? esheet->wb->gnum_wb : NULL;
tmp = expr_tree_as_string (expr, parse_pos_init (&pp, wb, sheet, 0, 0));
tmp = gnm_expr_as_string (expr, parse_pos_init (&pp, wb, sheet, 0, 0));
puts (tmp);
g_free (tmp);
}
......@@ -152,7 +152,7 @@ ms_sheet_parse_expr_internal (ExcelSheet *esheet, guint8 const *data, int length
return expr;
}
static ExprTree *
static GnmExpr const *
ms_sheet_parse_expr (MSContainer *container, guint8 const *data, int length)
{
return ms_sheet_parse_expr_internal ((ExcelSheet *)container,
......@@ -1177,15 +1177,15 @@ biff_format_data_destroy (gpointer key, BiffFormatData *d, gpointer userdata)
}
static void
ms_excel_add_name (ExcelWorkbook *ewb, NamedExpression *nexpr)
ms_excel_add_name (ExcelWorkbook *ewb, GnmNamedExpr *nexpr)
{
g_ptr_array_add (ewb->names, nexpr);
}
ExprTree *
GnmExpr const *
ms_excel_workbook_get_name (ExcelWorkbook const *ewb, int idx)
{
NamedExpression *nexpr = NULL;
GnmNamedExpr *nexpr = NULL;
GPtrArray *a;
g_return_val_if_fail (ewb, NULL);
......@@ -1195,10 +1195,10 @@ ms_excel_workbook_get_name (ExcelWorkbook const *ewb, int idx)
if (a == NULL || idx < 0 || (int)a->len <= idx ||
(nexpr = g_ptr_array_index (a, idx)) == NULL) {
g_warning ("EXCEL: %x (of %x) UNKNOWN name\n", idx, a->len);
return expr_tree_new_constant (value_new_string ("Unknown name"));
return gnm_expr_new_constant (value_new_string ("Unknown name"));
}
return expr_tree_new_name (nexpr, NULL, NULL);
return gnm_expr_new_name (nexpr, NULL, NULL);
}
EXCEL_PALETTE_ENTRY const excel_default_palette[EXCEL_DEF_PAL_LEN] = {
......@@ -1568,7 +1568,8 @@ ms_excel_set_xf (ExcelSheet *esheet, int col, int row, guint16 xfidx)
d (2, printf ("%s!%s%d = xf(%d)\n", esheet->gnum_sheet->name_unquoted,
col_name (col), row + 1, xfidx););
if (xfidx > 0) {
/* no need to reapply the default */
if (xfidx != 15) {
MStyle *const mstyle = ms_excel_get_style_from_xf (esheet, xfidx);
if (mstyle == NULL)
return;
......@@ -1582,22 +1583,25 @@ ms_excel_set_xf_segment (ExcelSheet *esheet,
int start_col, int end_col,
int start_row, int end_row, guint16 xfidx)
{
Range range;
MStyle * const mstyle = ms_excel_get_style_from_xf (esheet, xfidx);
/* no need to reapply the default */
if (xfidx != 15) {
Range range;
MStyle * const mstyle = ms_excel_get_style_from_xf (esheet, xfidx);
if (mstyle == NULL)
return;
if (mstyle == NULL)
return;
range.start.col = start_col;
range.start.row = start_row;
range.end.col = end_col;
range.end.row = end_row;
sheet_style_set_range (esheet->gnum_sheet, &range, mstyle);
range.start.col = start_col;
range.start.row = start_row;
range.end.col = end_col;
range.end.row = end_row;
sheet_style_set_range (esheet->gnum_sheet, &range, mstyle);
d (2, {
range_dump (&range, "");
fprintf (stderr, " = xf(%d)\n", xfidx);
});
d (2, {
range_dump (&range, "");
fprintf (stderr, " = xf(%d)\n", xfidx);
});
}
}
static StyleBorderType
......@@ -1957,7 +1961,7 @@ biff_shared_formula_destroy (gpointer key, BiffSharedFormula *sf,
return TRUE;
}
static ExprTree *
static GnmExpr const *
ms_excel_formula_shared (BiffQuery *q, ExcelSheet *esheet, Cell *cell)
{
int has_next_record = ms_biff_query_next (q);
......@@ -1973,7 +1977,7 @@ ms_excel_formula_shared (BiffQuery *q, ExcelSheet *esheet, Cell *cell)
guint8 *data = q->data + (is_array ? 14 : 10);
guint16 const data_len =
MS_OLE_GET_GUINT16 (q->data + (is_array ? 12 : 8));
ExprTree *expr = ms_excel_parse_formula (
GnmExpr const *expr = ms_excel_parse_formula (
esheet->wb, esheet, array_col_first, array_row_first,
data, data_len, !is_array, NULL);
BiffSharedFormula *sf = g_new (BiffSharedFormula, 1);
......@@ -2034,7 +2038,7 @@ ms_excel_read_formula (BiffQuery *q, ExcelSheet *esheet)
guint16 const col = EX_GETCOL (q);
guint16 const row = EX_GETROW (q);
guint16 const options = MS_OLE_GET_GUINT16 (q->data + 14);
ExprTree *expr;
GnmExpr const *expr;
Cell *cell;
Value *val = NULL;
......@@ -2191,7 +2195,7 @@ ms_excel_read_formula (BiffQuery *q, ExcelSheet *esheet)
/* Just in case things screwed up, at least save the value */
if (expr != NULL) {
cell_set_expr_and_value (cell, expr, val, TRUE);
expr_tree_unref (expr);
gnm_expr_unref (expr);
} else
cell_assign_value (cell, val);
} else {
......@@ -2320,7 +2324,7 @@ ms_excel_sheet_destroy (ExcelSheet *esheet, gboolean destroy_gnumeric_sheet)
g_free (esheet);
}
static ExprTree *
static GnmExpr const *
ms_wb_parse_expr (MSContainer *container, guint8 const *data, int length)
{
ExcelSheet dummy_sheet;
......@@ -2532,20 +2536,20 @@ typedef struct {
int name_index;
} MSDelayedNameParse;
static NamedExpression *
static GnmNamedExpr *
ms_excel_parse_NAME (ExcelWorkbook *ewb, int sheet_index,
char *name, guint8 const *expr_data, unsigned expr_len)
{
ParsePos pp;
ExprTree *expr;
NamedExpression *nexpr;
GnmExpr const *expr;
GnmNamedExpr *nexpr;
char const *err = NULL;
/* I think it is ok to pass sheet = NULL */
expr = ms_excel_parse_formula (ewb, NULL, 0, 0,
expr_data, expr_len, FALSE, NULL);
if (expr == NULL)
expr = expr_tree_new_constant ( value_new_error (NULL, gnumeric_err_REF));
expr = gnm_expr_new_constant (value_new_error (NULL, gnumeric_err_REF));
parse_pos_init (&pp, ewb->gnum_wb, NULL, 0, 0);
if (sheet_index > 0)
......@@ -2588,7 +2592,7 @@ static void
ms_excel_read_NAME (BiffQuery *q, ExcelWorkbook *ewb)
{
MSDelayedNameParse *delay = NULL;
NamedExpression *nexpr = NULL;
GnmNamedExpr *nexpr = NULL;
guint16 flags = MS_OLE_GET_GUINT16 (q->data);
/*guint8 kb_shortcut = MS_OLE_GET_GUINT8 (q->data + 2); */
guint8 name_len = MS_OLE_GET_GUINT8 (q->data + 3);
......@@ -2689,7 +2693,7 @@ ms_excel_read_NAME (BiffQuery *q, ExcelWorkbook *ewb)
static void
ms_excel_externname (BiffQuery *q, ExcelWorkbook *wb, ExcelSheet *esheet)
{
NamedExpression *nexpr = NULL;
GnmNamedExpr *nexpr = NULL;
char *name = NULL;
/* NOTE : The name is associated with the last EXTERNSHEET records seen */
......@@ -2701,7 +2705,7 @@ ms_excel_externname (BiffQuery *q, ExcelWorkbook *wb, ExcelSheet *esheet)
case 0x00: { /* external name */
name = biff_get_text (q->data + 7, namelen, &namelen);
#if 0
ExprTree *expr;
GnmExpr const *expr;
/* TODO : understand what an external name is */
expr = ms_sheet_parse_expr_internal (esheet,
......@@ -3396,7 +3400,7 @@ ms_excel_read_cf (BiffQuery *q, ExcelSheet *esheet)
guint16 const expr2_len = MS_OLE_GET_GUINT8 (q->data + 4);
guint8 const fmt_type = MS_OLE_GET_GUINT8 (q->data + 9);
unsigned offset;
ExprTree *expr1 = NULL, *expr2 = NULL;
GnmExpr const *expr1 = NULL, *expr2 = NULL;
d(-1, printf ("cond type = %d, op type = %d\n", (int)type, (int)op););
#if 0
......@@ -3566,8 +3570,8 @@ ms_excel_read_condfmt (BiffQuery *q, ExcelSheet *esheet)
static void
ms_excel_read_dv (BiffQuery *q, ExcelSheet *esheet)
{
ExprTree *expr1 = NULL, *expr2 = NULL;
int expr1_len, expr2_len;
GnmExpr const *expr1 = NULL, *expr2 = NULL;
int expr1_len, expr2_len;
char *input_msg, *error_msg, *input_title, *error_title;
guint32 options, len;
guint8 const *data, *expr1_dat, *expr2_dat;
......@@ -3748,7 +3752,7 @@ ms_excel_read_sheet (BiffQuery *q, ExcelWorkbook *wb,
esheet->gnum_sheet->name_unquoted););
/* Apply the default style */
mstyle = ms_excel_get_style_from_xf (esheet, 0);
mstyle = ms_excel_get_style_from_xf (esheet, 15);
if (mstyle != NULL) {
Range r;
sheet_style_set_range (esheet->gnum_sheet,
......
......@@ -114,7 +114,7 @@ typedef struct _ExcelWorkbook
char *biff_get_text (guint8 const *ptr, guint32 length, guint32 *byte_length);
char const *biff_get_error_text (guint8 err);
ExprTree *ms_excel_workbook_get_name (ExcelWorkbook const *ewb, int idx);
GnmExpr const *ms_excel_workbook_get_name (ExcelWorkbook const *ewb, int idx);
ExcelSheet *ms_excel_workbook_get_sheet (ExcelWorkbook const *wb, guint idx);
XLExternSheetV8 const *ms_excel_workbook_get_externsheet_v8 (ExcelWorkbook const *wb,
guint idx);
......
......@@ -44,6 +44,7 @@
#include <workbook.h>
#include <io-context.h>
#include <expr.h>
#include <expr-impl.h>
#include <expr-name.h>
#include <gutils.h>
#include <str.h>
......@@ -560,7 +561,7 @@ write_names (BiffPut *bp, ExcelWorkbook *wb)
guint16 len, name_len;
char *text;
NamedExpression const *expr_name = names->data;
GnmNamedExpr const *expr_name = names->data;
g_return_if_fail (expr_name != NULL);
......@@ -2559,7 +2560,7 @@ write_formula (BiffPut *bp, ExcelSheet *esheet, const Cell *cell, gint16 xf)
gboolean string_result = FALSE;
gint col, row;
Value *v;
ExprTree*expr;
GnmExpr const *expr;
g_return_if_fail (bp);
g_return_if_fail (cell);
......@@ -2624,7 +2625,7 @@ write_formula (BiffPut *bp, ExcelSheet *esheet, const Cell *cell, gint16 xf)
ms_biff_put_commit (bp);
if (expr->any.oper == OPER_ARRAY &&
if (expr->any.oper == GNM_EXPR_OP_ARRAY &&
expr->array.x == 0 && expr->array.y == 0) {
ms_biff_put_var_next (bp, BIFF_ARRAY);
MS_OLE_SET_GUINT16 (data+0, cell->pos.row);
......@@ -2743,7 +2744,7 @@ write_cell (BiffPut *bp, ExcelSheet *esheet, const ExcelCell *cell)
printf ("Writing cell at %s '%s' = '%s', xf = 0x%x\n",
cell_name (gnum_cell),
(cell_has_expr (gnum_cell) ?
expr_tree_as_string (gnum_cell->base.expression,
gnm_expr_as_string (gnum_cell->base.expression,
parse_pos_init_cell (&tmp, gnum_cell)) :
"none"),
(gnum_cell->value ?
......
......@@ -17,6 +17,7 @@
#include <gutils.h>
#include <func.h>
#include <value.h>
#include <expr-impl.h>
#include <expr-name.h>
#include <str.h>
#include <parse-util.h>
......@@ -420,10 +421,10 @@ const FormulaFuncData formula_func_data[FORMULA_FUNC_DATA_LEN] =
/* 367 */ { "VARA", -1 }
};
static ExprTree *
static GnmExpr const *
expr_tree_string (char const *str)
{
return expr_tree_new_constant (value_new_string (str));
return gnm_expr_new_constant (value_new_string (str));
}
/**
......@@ -514,7 +515,7 @@ getRefV8 (CellRef *cr,
}
static void
parse_list_push (ExprList **list, ExprTree *pd)
parse_list_push (GnmExprList **list, GnmExpr const *pd)
{
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 5) {
......@@ -523,22 +524,22 @@ parse_list_push (ExprList **list, ExprTree *pd)
#endif
if (!pd)
printf ("FIXME: Pushing nothing onto excel function stack\n");
*list = expr_list_prepend (*list, pd);
*list = gnm_expr_list_prepend (*list, pd);
}
static void
parse_list_push_raw (ExprList **list, Value *v)
parse_list_push_raw (GnmExprList **list, Value *v)
{
parse_list_push (list, expr_tree_new_constant (v));
parse_list_push (list, gnm_expr_new_constant (v));
}
static ExprTree *
parse_list_pop (ExprList **list)
static GnmExpr const *
parse_list_pop (GnmExprList **list)
{
/* Get the head */
ExprList *tmp = g_slist_nth (*list, 0);
GnmExprList *tmp = g_slist_nth (*list, 0);
if (tmp != NULL)
{
ExprTree *ans = tmp->data;
GnmExpr const *ans = tmp->data;
*list = g_slist_remove (*list, ans);
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 5) {
......@@ -555,25 +556,25 @@ parse_list_pop (ExprList **list)
/**
* Returns a new list composed of the last n items pop'd off the list.
**/
static ExprList *
parse_list_last_n (ExprList **list, gint n)
static GnmExprList *
parse_list_last_n (GnmExprList **list, gint n)
{
ExprList *l = NULL;
GnmExprList *l = NULL;
while (n-->0)
l = g_slist_prepend (l, parse_list_pop(list));
l = gnm_expr_list_prepend (l, parse_list_pop(list));
return l;
}
static void
parse_list_free (ExprList **list)
parse_list_free (GnmExprList **list)
{
while (*list)
expr_tree_unref (parse_list_pop(list));
gnm_expr_unref (parse_list_pop(list));
}
static gboolean
make_function (ExprList **stack, int fn_idx, int numargs)
make_function (GnmExprList **stack, int fn_idx, int numargs)
{
FunctionDefinition *name = NULL;
......@@ -584,21 +585,21 @@ make_function (ExprList **stack, int fn_idx, int numargs)
* name should be on top of the stack.
*/
/* FIXME FIXME FIXME : How to handle missing trailing args ?? */
ExprList *args = parse_list_last_n (stack, numargs-1);
ExprTree *tmp = parse_list_pop (stack);
GnmExprList *args = parse_list_last_n (stack, numargs-1);
GnmExpr const *tmp = parse_list_pop (stack);
char const *f_name = NULL;
if (tmp != NULL) {
if (tmp->any.oper == OPER_CONSTANT &&
if (tmp->any.oper == GNM_EXPR_OP_CONSTANT &&
tmp->constant.value->type == VALUE_STRING)
f_name = tmp->constant.value->v_str.val->str;
else if (tmp->any.oper == OPER_NAME)
else if (tmp->any.oper == GNM_EXPR_OP_NAME)
f_name = tmp->name.name->name->str;
}
if (f_name == NULL) {
if (tmp)
expr_tree_unref (tmp);
gnm_expr_unref (tmp);
parse_list_free (&args);
parse_list_push_raw (stack,
value_new_error (NULL, _("Broken function")));
......@@ -611,12 +612,12 @@ make_function (ExprList **stack, int fn_idx, int numargs)
if (name == NULL)
name = function_add_placeholder (f_name, "");
expr_tree_unref (tmp);
parse_list_push (stack, expr_tree_new_funcall (name, args));
gnm_expr_unref (tmp);
parse_list_push (stack, gnm_expr_new_funcall (name, args));
return TRUE;
} else if (fn_idx >= 0 && fn_idx < FORMULA_FUNC_DATA_LEN) {
const FormulaFuncData *fd = &formula_func_data[fn_idx];
ExprList *args;
GnmExprList *args;
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 0) {
......@@ -658,7 +659,7 @@ make_function (ExprList **stack, int fn_idx, int numargs)
parse_list_free (&args);
return FALSE;
}
parse_list_push (stack, expr_tree_new_funcall (name, args));
parse_list_push (stack, gnm_expr_new_funcall (name, args));
return TRUE;
} else
printf ("FIXME, unimplemented fn 0x%x, with %d args\n",
......@@ -681,37 +682,37 @@ ms_excel_dump_cellname (ExcelWorkbook const *ewb, ExcelSheet const *esheet,
}
/* Binary operator tokens */
static Operation const binary_ops [] = {
OPER_ADD, /* 0x03, ptgAdd */
OPER_SUB, /* 0x04, ptgSub */
OPER_MULT, /* 0x05, ptgMul */
OPER_DIV, /* 0x06, ptgDiv */
OPER_EXP, /* 0x07, ptgPower */
OPER_CONCAT, /* 0x08, ptgConcat */
OPER_LT, /* 0x09, ptgLT */
OPER_LTE, /* 0x0a, ptgLTE */
OPER_EQUAL, /* 0x0b, ptgEQ */
OPER_GTE, /* 0x0c, ptgGTE */
OPER_GT, /* 0x0d, ptgGT */
OPER_NOT_EQUAL, /* 0x0e, ptgNE */
static GnmExprOp const binary_ops [] = {
GNM_EXPR_OP_ADD, /* 0x03, ptgAdd */
GNM_EXPR_OP_SUB, /* 0x04, ptgSub */
GNM_EXPR_OP_MULT, /* 0x05, ptgMul */
GNM_EXPR_OP_DIV, /* 0x06, ptgDiv */
GNM_EXPR_OP_EXP, /* 0x07, ptgPower */
GNM_EXPR_OP_CAT, /* 0x08, ptgConcat */
GNM_EXPR_OP_LT, /* 0x09, ptgLT */
GNM_EXPR_OP_LTE, /* 0x0a, ptgLTE */
GNM_EXPR_OP_EQUAL, /* 0x0b, ptgEQ */
GNM_EXPR_OP_GTE, /* 0x0c, ptgGTE */
GNM_EXPR_OP_GT, /* 0x0d, ptgGT */
GNM_EXPR_OP_NOT_EQUAL, /* 0x0e, ptgNE */
/* FIXME: These need implementing ... */
OPER_ADD, /* 0x0f, ptgIsect : Intersection */
OPER_ADD, /* 0x10, ptgUnion : Union */
OPER_ADD, /* 0x11, ptgRange : Range */
GNM_EXPR_OP_ADD, /* 0x0f, ptgIsect : Intersection */
GNM_EXPR_OP_ADD, /* 0x10, ptgUnion : Union */
GNM_EXPR_OP_ADD, /* 0x11, ptgRange : Range */
};
static Operation const unary_ops [] = {
OPER_UNARY_PLUS,/* 0x12, ptgU_PLUS */
OPER_UNARY_NEG, /* 0x13, ptgU_MINUS */
OPER_PERCENT, /* 0x14, ptgPERCENT */
static GnmExprOp const unary_ops [] = {
GNM_EXPR_OP_UNARY_PLUS,/* 0x12, ptgU_PLUS */
GNM_EXPR_OP_UNARY_NEG, /* 0x13, ptgU_MINUS */
GNM_EXPR_OP_PERCENTAGE, /* 0x14, ptgPERCENT */
};
/**
* Parse that RP Excel formula, see S59E2B.HTM
* Return a dynamicly allocated ExprTree containing the formula, or NULL
* Return a dynamicly allocated GnmExpr containing the formula, or NULL