projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Encapsulated lexer and updated calling functions accordingly.
[pspp]
/
src
/
language
/
stats
/
means.q
diff --git
a/src/language/stats/means.q
b/src/language/stats/means.q
index fb03f754518f1ede12c3f42bbc67a99afc14c125..b7a2da2065041fb5e2dd4d528391a6431a9e021d 100644
(file)
--- a/
src/language/stats/means.q
+++ b/
src/language/stats/means.q
@@
-44,7
+44,7
@@
name:!names/nonames,
val:!values/novalues,
fmt:!table/tree;
name:!names/nonames,
val:!values/novalues,
fmt:!table/tree;
-
+
missing=miss:!table/include/dependent;
+ missing=miss:!table/include/dependent;
+cells[cl_]=default,count,sum,mean,stddev,variance,all;
+statistics[st_]=anova,linearity,all,none.
*/
+cells[cl_]=default,count,sum,mean,stddev,variance,all;
+statistics[st_]=anova,linearity,all,none.
*/
@@
-52,17
+52,16
@@
/* (functions) */
/* TABLES: Variable lists for each dimension. */
/* (functions) */
/* TABLES: Variable lists for each dimension. */
-
int n_dim;
/* Number of dimensions. */
-s
ize_t *nv_dim;
/* Number of variables in each dimension. */
-st
ruct variable ***v_dim;
/* Variables in each dimension. */
+
static int n_dim;
/* Number of dimensions. */
+s
tatic size_t *nv_dim;
/* Number of variables in each dimension. */
+st
atic struct variable ***v_dim;
/* Variables in each dimension. */
/* VARIABLES: List of variables. */
/* VARIABLES: List of variables. */
-int n_var;
-struct variable **v_var;
+static struct variable **v_var;
/* Parses and executes the T-TEST procedure. */
int
/* Parses and executes the T-TEST procedure. */
int
-cmd_means (
void
)
+cmd_means (
struct lexer *lexer, struct dataset *ds
)
{
struct cmd_means cmd;
int success = CMD_FAILURE;
{
struct cmd_means cmd;
int success = CMD_FAILURE;
@@
-72,7
+71,7
@@
cmd_means (void)
v_dim = NULL;
v_var = NULL;
v_dim = NULL;
v_var = NULL;
- if (!parse_means (&cmd, NULL))
+ if (!parse_means (
lexer, ds,
&cmd, NULL))
goto free;
if (cmd.sbc_cells)
goto free;
if (cmd.sbc_cells)
@@
-123,15
+122,15
@@
free:
/* Parses the TABLES subcommand. */
static int
/* Parses the TABLES subcommand. */
static int
-mns_custom_tables (struct cmd_means *cmd, void *aux UNUSED)
+mns_custom_tables (struct
lexer *lexer, struct dataset *ds, struct
cmd_means *cmd, void *aux UNUSED)
{
struct var_set *var_set;
{
struct var_set *var_set;
- if (!lex_match_id ("TABLES")
- && (
token != T_ID || dict_lookup_var (default_dict, tokid
) == NULL)
- &&
token
!= T_ALL)
+ if (!lex_match_id (
lexer,
"TABLES")
+ && (
lex_token (lexer) != T_ID || dict_lookup_var (dataset_dict (ds), lex_tokid (lexer)
) == NULL)
+ &&
lex_token (lexer)
!= T_ALL)
return 2;
return 2;
- lex_match ('=');
+ lex_match (
lexer,
'=');
if (cmd->sbc_tables)
{
if (cmd->sbc_tables)
{
@@
-140,7
+139,7
@@
mns_custom_tables (struct cmd_means *cmd, void *aux UNUSED)
return 0;
}
return 0;
}
- var_set = var_set_create_from_dict (d
efault_dict
);
+ var_set = var_set_create_from_dict (d
ataset_dict (ds)
);
assert (var_set != NULL);
do
assert (var_set != NULL);
do
@@
-148,7
+147,7
@@
mns_custom_tables (struct cmd_means *cmd, void *aux UNUSED)
size_t nvl;
struct variable **vl;
size_t nvl;
struct variable **vl;
- if (!parse_var_set_vars (var_set, &vl, &nvl,
+ if (!parse_var_set_vars (
lexer,
var_set, &vl, &nvl,
PV_NO_DUPLICATE | PV_NO_SCRATCH))
goto lossage;
PV_NO_DUPLICATE | PV_NO_SCRATCH))
goto lossage;
@@
-159,7
+158,7
@@
mns_custom_tables (struct cmd_means *cmd, void *aux UNUSED)
nv_dim[n_dim - 1] = nvl;
v_dim[n_dim - 1] = vl;
}
nv_dim[n_dim - 1] = nvl;
v_dim[n_dim - 1] = vl;
}
- while (lex_match (T_BY));
+ while (lex_match (
lexer,
T_BY));
var_set_destroy (var_set);
return 1;
var_set_destroy (var_set);
return 1;