#include <assert.h>
#include <stddef.h>
-#include "format.h"
-#include "str.h"
+#include <data/format.h>
+#include <libpspp/str.h>
#include "public.h"
#include "operations.h"
OPF_UNIMPLEMENTED = 020,
/* If set, this operation is a PSPP extension. */
- OPF_EXTENSION = 040
+ OPF_EXTENSION = 040,
+
+ /* If set, this operation may not occur after TEMPORARY.
+ (Currently this applies only to LAG.) */
+ OPF_PERM_ONLY = 0100
};
#define EXPR_ARG_MAX 4
int array_granularity;
};
-extern struct operation operations[];
+extern const struct operation operations[];
/* Tree structured expressions. */
struct string_node
{
operation_type type; /* OP_string. */
- struct fixed_string s;
+ struct substring s;
};
struct variable_node
{
operation_type operation;
double number;
- struct fixed_string string;
+ struct substring string;
struct variable *variable;
const struct vector *vector;
struct fmt_spec *format;
size_t op_cnt, op_cap; /* Number of ops, amount of allocated space. */
double *number_stack; /* Evaluation stack: numerics, Booleans. */
- struct fixed_string *string_stack; /* Evaluation stack: strings. */
+ struct substring *string_stack; /* Evaluation stack: strings. */
struct pool *eval_pool; /* Pool for evaluation temporaries. */
};
union any_node *expr_allocate_string_buffer (struct expression *e,
const char *string, size_t length);
union any_node *expr_allocate_string (struct expression *e,
- struct fixed_string);
+ struct substring);
union any_node *expr_allocate_variable (struct expression *e,
struct variable *);
union any_node *expr_allocate_format (struct expression *e,