opts.read_names = false;
opts.asw = -1;
- lex_force_match (lexer, T_SLASH);
+ if (! lex_force_match (lexer, T_SLASH))
+ goto error;
if (!lex_force_match_id (lexer, "TYPE"))
goto error;
psql.bsize = -1;
ds_init_empty (&psql.sql);
- lex_force_match (lexer, T_SLASH);
+ if (! lex_force_match (lexer, T_SLASH))
+ goto error;
if (!lex_force_match_id (lexer, "CONNECT"))
goto error;
- lex_force_match (lexer, T_EQUALS);
+ if (! lex_force_match (lexer, T_EQUALS))
+ goto error;
if (!lex_force_string (lexer))
goto error;
opts->read_names = true;
opts->asw = -1;
- lex_force_match (lexer, T_SLASH);
+ if (! lex_force_match (lexer, T_SLASH))
+ goto error;
if (!lex_force_match_id (lexer, "FILE"))
goto error;
- lex_force_match (lexer, T_EQUALS);
+ if (! lex_force_match (lexer, T_EQUALS))
+ goto error;
if (!lex_force_string (lexer))
goto error;
enum data_parser_type type;
bool has_type;
- lex_force_match (lexer, T_SLASH);
+ if (! lex_force_match (lexer, T_SLASH))
+ goto error;
if (!lex_force_match_id (lexer, "FILE"))
goto error;
- lex_force_match (lexer, T_EQUALS);
+ if (! lex_force_match (lexer, T_EQUALS))
+ goto error;
fh = fh_parse (lexer, FH_REF_FILE | FH_REF_INLINE, NULL);
if (fh == NULL)
goto error;
else
break;
}
- if (lex_token (lexer) != T_SLASH)
- {
- lex_force_match (lexer, T_SLASH);
+
+ if (!lex_force_match (lexer, T_SLASH))
goto done;
- }
-
- lex_get (lexer);
expr = expr_parse_any (lexer, ds, optimize);
if (!expr || lex_end_of_command (lexer) != CMD_SUCCESS)
{
if (function->src_vars == AGR_SV_YES)
{
- lex_force_match (lexer, T_LPAREN);
goto error;
}
}
}
nx *= by_nvar[n_by];
n_by++;
-
+
if (!lex_match (lexer, T_BY))
{
if (n_by < 2)
- {
- lex_force_match (lexer, T_BY);
- goto done;
- }
+ goto done;
else
break;
}
dsc->sort_ascending = 0;
else
lex_error (lexer, NULL);
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
else if (var_cnt == 0)
{
factor.promax_power = lex_integer (lexer);
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
factor.rotation = ROT_PROMAX;
}
{
factor.n_factors = lex_integer (lexer);
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
else if (lex_match_id (lexer, "MINEIGEN"))
{
factor.min_eigen = lex_number (lexer);
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
else if (lex_match_id (lexer, "ECONVERGE"))
{
factor.econverge = lex_number (lexer);
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
else if (lex_match_id (lexer, "RCONVERGE"))
{
factor.rconverge = lex_number (lexer);
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
else if (lex_match_id (lexer, "ITERATE"))
{
n_iterations = lex_integer (lexer);
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
else if (lex_match_id (lexer, "DEFAULT"))
{
factor.blank = lex_number (lexer);
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
else if (lex_match_id (lexer, "DEFAULT"))
lex_error (lexer, _("Histogram frequency must be greater than zero."));
}
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
}
lex_error (lexer, _("Histogram percentage must be greater than zero."));
}
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
}
else if (lex_match_id (lexer, "MINIMUM"))
{
- lex_force_match (lexer, T_LPAREN);
+ if (! lex_force_match (lexer, T_LPAREN))
+ goto error;
if (lex_force_num (lexer))
{
hi_min = lex_number (lexer);
lex_get (lexer);
}
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
else if (lex_match_id (lexer, "MAXIMUM"))
{
- lex_force_match (lexer, T_LPAREN);
+ if (! lex_force_match (lexer, T_LPAREN))
+ goto error;
if (lex_force_num (lexer))
{
hi_max = lex_number (lexer);
lex_get (lexer);
}
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
else
{
{
if (lex_match_id (lexer, "MINIMUM"))
{
- lex_force_match (lexer, T_LPAREN);
+ if (! lex_force_match (lexer, T_LPAREN))
+ goto error;
if (lex_force_num (lexer))
{
pie_min = lex_number (lexer);
lex_get (lexer);
}
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
else if (lex_match_id (lexer, "MAXIMUM"))
{
- lex_force_match (lexer, T_LPAREN);
+ if (! lex_force_match (lexer, T_LPAREN))
+ goto error;
if (lex_force_num (lexer))
{
pie_max = lex_number (lexer);
lex_get (lexer);
}
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
else if (lex_match_id (lexer, "MISSING"))
{
{
if (lex_match_id (lexer, "MINIMUM"))
{
- lex_force_match (lexer, T_LPAREN);
+ if (! lex_force_match (lexer, T_LPAREN))
+ goto error;
if (lex_force_num (lexer))
{
bar_min = lex_number (lexer);
lex_get (lexer);
}
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
else if (lex_match_id (lexer, "MAXIMUM"))
{
- lex_force_match (lexer, T_LPAREN);
+ if (! lex_force_match (lexer, T_LPAREN))
+ goto error;
if (lex_force_num (lexer))
{
bar_max = lex_number (lexer);
lex_get (lexer);
}
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
else if (lex_match_id (lexer, "FREQ"))
{
lex_number (lexer);
lex_get (lexer);
}
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
bar_freq = true;
}
lex_number (lexer);
lex_get (lexer);
}
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
bar_freq = false;
}
PV_NO_DUPLICATE | PV_NUMERIC))
goto error;
- lex_force_match (lexer, T_BY);
+ if (! lex_force_match (lexer, T_BY))
+ goto error;
if (!parse_variables_const (lexer, glm.dict,
&glm.factor_vars, &glm.n_factor_vars,
if (! (lr.dep_var = parse_variable_const (lexer, lr.dict)))
goto error;
- lex_force_match (lexer, T_WITH);
+ if (! lex_force_match (lexer, T_WITH))
+ goto error;
if (!parse_variables_const (lexer, lr.dict,
&pred_vars, &n_pred_vars,
/* Optional TABLES = */
if (lex_match_id (lexer, "TABLES"))
{
- lex_force_match (lexer, T_EQUALS);
+ if (! lex_force_match (lexer, T_EQUALS))
+ goto error;
}
if (lex_is_variable (lexer, means.dict, 1) )
{
more_tables = true;
- lex_force_match (lexer, T_SLASH);
+ lex_match (lexer, T_SLASH);
}
}
}
if ( ! lex_force_num (lexer)) return 0;
cstp->lo = lex_number (lexer);
lex_get (lexer);
- lex_force_match (lexer, T_COMMA);
+ if (! lex_force_match (lexer, T_COMMA)) return 0;
if (! lex_force_num (lexer) ) return 0;
cstp->hi = lex_number (lexer);
if ( cstp->lo >= cstp->hi )
cstp->expected = NULL;
if (lex_match_phrase (lexer, "/EXPECTED"))
{
- lex_force_match (lexer, T_EQUALS);
- if ( ! lex_match_id (lexer, "EQUAL") )
+ if (! lex_force_match (lexer, T_EQUALS)) return 0;
+ if (! lex_match_id (lexer, "EQUAL") )
{
double f;
int n;
{
btp->p = lex_number (lexer);
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (!lex_force_match (lexer, T_RPAREN))
+ return 0;
}
else
return 0;
btp->cutpoint = btp->category1;
}
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ return 0;
}
}
else
{
mt->median = lex_number (lexer);
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ return 0;
}
lex_match (lexer, T_EQUALS);
if ( lex_match (lexer, T_LPAREN))
{
- if ( lex_force_num (lexer) )
+ if (lex_force_num (lexer) )
{
specs->timer = lex_number (lexer);
lex_get (lexer);
}
- lex_force_match (lexer, T_RPAREN);
+ if (lex_force_match (lexer, T_RPAREN))
+ return 0;
}
}
}
PV_NO_DUPLICATE | PV_NUMERIC))
goto error;
- lex_force_match (lexer, T_BY);
+ if (!lex_force_match (lexer, T_BY))
+ goto error;
oneway.indep_var = parse_variable_const (lexer, dict);
if (oneway.indep_var == NULL)
{
if ( !lex_force_match (lexer, T_LPAREN))
goto error;
- lex_force_num (lexer);
+ if (! lex_force_num (lexer))
+ goto error;
oneway.alpha = lex_number (lexer);
lex_get (lexer);
if ( !lex_force_match (lexer, T_RPAREN))
goto error;
}
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (!lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
else if (lex_match_id (lexer, "CONVERGE"))
goto error;
}
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (!lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
else if (lex_match_id (lexer, "MXITER"))
goto error;
}
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (!lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
else if (lex_match_id (lexer, "NOINITIAL"))
string_set_init (&new_names);
if (lex_match_id (lexer, "VARIABLES"))
- lex_force_match (lexer, T_EQUALS);
+ if (! lex_force_match (lexer, T_EQUALS))
+ goto error;
if (!parse_sort_criteria (lexer, rank.dict,
&rank.sc,
while (lex_token (lexer) != T_ENDCMD )
{
- lex_force_match (lexer, T_SLASH);
+ if (! lex_force_match (lexer, T_SLASH))
+ goto error;
if (lex_match_id (lexer, "TIES"))
{
- lex_force_match (lexer, T_EQUALS);
+ if (! lex_force_match (lexer, T_EQUALS))
+ goto error;
if (lex_match_id (lexer, "MEAN"))
{
rank.ties = TIES_MEAN;
}
else if (lex_match_id (lexer, "FRACTION"))
{
- lex_force_match (lexer, T_EQUALS);
+ if (! lex_force_match (lexer, T_EQUALS))
+ goto error;
if (lex_match_id (lexer, "BLOM"))
{
rank.fraction = FRAC_BLOM;
}
else if (lex_match_id (lexer, "PRINT"))
{
- lex_force_match (lexer, T_EQUALS);
+ if (! lex_force_match (lexer, T_EQUALS))
+ goto error;
if (lex_match_id (lexer, "YES"))
{
rank.print = true;
}
else if (lex_match_id (lexer, "MISSING"))
{
- lex_force_match (lexer, T_EQUALS);
+ if (! lex_force_match (lexer, T_EQUALS))
+ goto error;
if (lex_match_id (lexer, "INCLUDE"))
{
rank.exclude = MV_SYSTEM;
{
regression.ci = lex_number (lexer) / 100.0;
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
else
{
reliability.split_point = lex_number (lexer);
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
else
if (lex_match (lexer, T_LPAREN))
{
roc.reference = true;
- lex_force_match_id (lexer, "REFERENCE");
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match_id (lexer, "REFERENCE"))
+ goto error;
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
}
else if (lex_match_id (lexer, "NONE"))
{
if (lex_match_id (lexer, "CUTOFF"))
{
- lex_force_match (lexer, T_LPAREN);
+ if (! lex_force_match (lexer, T_LPAREN))
+ goto error;
if (lex_match_id (lexer, "INCLUDE"))
{
roc.exclude = MV_SYSTEM;
lex_error (lexer, NULL);
goto error;
}
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
else if (lex_match_id (lexer, "TESTPOS"))
{
- lex_force_match (lexer, T_LPAREN);
+ if (! lex_force_match (lexer, T_LPAREN))
+ goto error;
if (lex_match_id (lexer, "LARGE"))
{
roc.invert = false;
lex_error (lexer, NULL);
goto error;
}
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto error;
}
else if (lex_match_id (lexer, "CI"))
{
cut = false;
}
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto parse_failed;
}
else
{
goto parse_failed;
tt.confidence = lex_number (lexer);
lex_get (lexer);
- lex_force_match (lexer, T_RPAREN);
+ if (! lex_force_match (lexer, T_RPAREN))
+ goto parse_failed;
}
}
else
if (lex_match_id (lexer, "ONEPASS"))
two_pass = 0;
- if (lex_token (lexer) != T_SLASH)
- {
- lex_force_match (lexer, T_SLASH);
+ if (!lex_force_match (lexer, T_SLASH))
goto done;
- }
- lex_get (lexer);
if (two_pass)
{
int
cmd_permissions (struct lexer *lexer, struct dataset *ds UNUSED)
{
- char *fn = 0;
-
+ char *fn = NULL;
+ const char *str = NULL;
lex_match (lexer, T_SLASH);
if (lex_match_id (lexer, "FILE"))
lex_match (lexer, T_EQUALS);
- if (!lex_force_string (lexer))
- return CMD_FAILURE;
-
- fn = ss_xstrdup (lex_tokss (lexer));
- lex_force_match (lexer, T_STRING);
+ str = lex_tokcstr (lexer);
+ fn = strdup (str);
+ if (!lex_force_match (lexer, T_STRING))
+ goto error;
lex_match (lexer, T_SLASH);
if ( lex_match_id (lexer, "READONLY"))
{
- if ( ! change_permissions(fn, PER_RO ) )
+ if (! change_permissions (fn, PER_RO))
goto error;
}
- else if ( lex_match_id (lexer, "WRITEABLE"))
+ else if (lex_match_id (lexer, "WRITEABLE"))
{
- if ( ! change_permissions(fn, PER_RW ) )
+ if (! change_permissions (fn, PER_RW ))
goto error;
}
else
goto error;
}
- free(fn);
+ free (fn);
return CMD_SUCCESS;
return 0;
}
-
locale_file_name = utf8_to_filename (file_name);
if ( -1 == stat(locale_file_name, &buf) )
{