X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fexpressions%2Fprivate.h;h=baf69c110eb4089d6fa2b54e7ee8b1abda518844;hb=3816248a008a4af75aac6319d0c9929cb7ff679e;hp=85b82587f5f895e4f0d8bb4eed29d1cb61b67ce5;hpb=dcf9b154cbcaa35c3d8459a201b77eec8bcb30bd;p=pspp diff --git a/src/language/expressions/private.h b/src/language/expressions/private.h index 85b82587f5..baf69c110e 100644 --- a/src/language/expressions/private.h +++ b/src/language/expressions/private.h @@ -22,8 +22,8 @@ #include #include -#include "format.h" -#include "str.h" +#include +#include #include "public.h" #include "operations.h" @@ -58,7 +58,11 @@ enum operation_flags 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 @@ -74,7 +78,7 @@ struct operation int array_granularity; }; -extern struct operation operations[]; +extern const struct operation operations[]; /* Tree structured expressions. */ @@ -88,7 +92,7 @@ struct number_node struct string_node { operation_type type; /* OP_string. */ - struct fixed_string s; + struct substring s; }; struct variable_node @@ -141,7 +145,7 @@ union operation_data { operation_type operation; double number; - struct fixed_string string; + struct substring string; struct variable *variable; const struct vector *vector; struct fmt_spec *format; @@ -152,7 +156,7 @@ union operation_data struct expression { struct pool *expr_pool; /* Pool for expression static data. */ - struct dictionary *dict; /* Dictionary for variables, vectors. */ + struct dataset *ds ; /* The dataset */ atom_type type; /* Type of expression result. */ union operation_data *ops; /* Expression data. */ @@ -160,11 +164,11 @@ struct expression 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. */ }; -struct expression *expr_parse_any (struct dictionary *, bool optimize); +struct expression *expr_parse_any (struct lexer *lexer, struct dataset *, bool optimize); void expr_debug_print_postfix (const struct expression *); union any_node *expr_optimize (union any_node *, struct expression *); @@ -186,7 +190,7 @@ union any_node *expr_allocate_pos_int (struct expression *e, int); 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,