+static int
+npar_median (struct lexer *lexer,
+ struct dataset *ds,
+ struct npar_specs *specs)
+{
+ struct median_test *mt = pool_alloc (specs->pool, sizeof (*mt));
+ struct n_sample_test *tp = &mt->parent;
+ struct npar_test *nt = &tp->parent;
+
+ mt->median = SYSMIS;
+
+ if ( lex_match (lexer, T_LPAREN) && lex_force_num (lexer))
+ {
+ mt->median = lex_number (lexer);
+ lex_get (lexer);
+ lex_force_match (lexer, T_RPAREN);
+ }
+
+ lex_match (lexer, T_EQUALS);
+
+ nt->insert_variables = n_sample_insert_variables;
+ nt->execute = median_execute;
+
+ if (!parse_n_sample_related_test (lexer, dataset_dict (ds),
+ tp, specs->pool) )
+ return 0;
+
+ specs->n_tests++;
+ specs->test = pool_realloc (specs->pool,
+ specs->test,
+ sizeof (*specs->test) * specs->n_tests);
+ specs->test[specs->n_tests - 1] = nt;
+
+ return 1;
+}