X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Froc.c;fp=src%2Flanguage%2Fstats%2Froc.c;h=22e4acb6fa161621ea2748eb5c33268a7b04e7b0;hb=691c25e36fd1ee722dd35419d6110e3876b99f9c;hp=dd2093674b16c34ecb8db3702687b6b38cd5245e;hpb=5a6b751888278c8c849ab0f4adf99f1be610e610;p=pspp diff --git a/src/language/stats/roc.c b/src/language/stats/roc.c index dd2093674b..22e4acb6fa 100644 --- a/src/language/stats/roc.c +++ b/src/language/stats/roc.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -95,7 +95,7 @@ cmd_roc (struct lexer *lexer, struct dataset *ds) roc.dict = dataset_dict (ds); roc.state_var = NULL; - lex_match (lexer, '/'); + lex_match (lexer, T_SLASH); if (!parse_variables_const (lexer, dict, &roc.vars, &roc.n_vars, PV_APPEND | PV_NO_DUPLICATE | PV_NUMERIC)) goto error; @@ -107,7 +107,7 @@ cmd_roc (struct lexer *lexer, struct dataset *ds) roc.state_var = parse_variable (lexer, dict); - if ( !lex_force_match (lexer, '(')) + if ( !lex_force_match (lexer, T_LPAREN)) { goto error; } @@ -116,19 +116,19 @@ cmd_roc (struct lexer *lexer, struct dataset *ds) parse_value (lexer, &roc.state_value, var_get_width (roc.state_var)); - if ( !lex_force_match (lexer, ')')) + if ( !lex_force_match (lexer, T_RPAREN)) { goto error; } - while (lex_token (lexer) != '.') + while (lex_token (lexer) != T_ENDCMD) { - lex_match (lexer, '/'); + lex_match (lexer, T_SLASH); if (lex_match_id (lexer, "MISSING")) { - lex_match (lexer, '='); - while (lex_token (lexer) != '.' && lex_token (lexer) != '/') + lex_match (lexer, T_EQUALS); + while (lex_token (lexer) != T_ENDCMD && lex_token (lexer) != T_SLASH) { if (lex_match_id (lexer, "INCLUDE")) { @@ -147,15 +147,15 @@ cmd_roc (struct lexer *lexer, struct dataset *ds) } else if (lex_match_id (lexer, "PLOT")) { - lex_match (lexer, '='); + lex_match (lexer, T_EQUALS); if (lex_match_id (lexer, "CURVE")) { roc.curve = true; - if (lex_match (lexer, '(')) + if (lex_match (lexer, T_LPAREN)) { roc.reference = true; lex_force_match_id (lexer, "REFERENCE"); - lex_force_match (lexer, ')'); + lex_force_match (lexer, T_RPAREN); } } else if (lex_match_id (lexer, "NONE")) @@ -170,8 +170,8 @@ cmd_roc (struct lexer *lexer, struct dataset *ds) } else if (lex_match_id (lexer, "PRINT")) { - lex_match (lexer, '='); - while (lex_token (lexer) != '.' && lex_token (lexer) != '/') + lex_match (lexer, T_EQUALS); + while (lex_token (lexer) != T_ENDCMD && lex_token (lexer) != T_SLASH) { if (lex_match_id (lexer, "SE")) { @@ -190,12 +190,12 @@ cmd_roc (struct lexer *lexer, struct dataset *ds) } else if (lex_match_id (lexer, "CRITERIA")) { - lex_match (lexer, '='); - while (lex_token (lexer) != '.' && lex_token (lexer) != '/') + lex_match (lexer, T_EQUALS); + while (lex_token (lexer) != T_ENDCMD && lex_token (lexer) != T_SLASH) { if (lex_match_id (lexer, "CUTOFF")) { - lex_force_match (lexer, '('); + lex_force_match (lexer, T_LPAREN); if (lex_match_id (lexer, "INCLUDE")) { roc.exclude = MV_SYSTEM; @@ -209,11 +209,11 @@ cmd_roc (struct lexer *lexer, struct dataset *ds) lex_error (lexer, NULL); goto error; } - lex_force_match (lexer, ')'); + lex_force_match (lexer, T_RPAREN); } else if (lex_match_id (lexer, "TESTPOS")) { - lex_force_match (lexer, '('); + lex_force_match (lexer, T_LPAREN); if (lex_match_id (lexer, "LARGE")) { roc.invert = false; @@ -227,19 +227,19 @@ cmd_roc (struct lexer *lexer, struct dataset *ds) lex_error (lexer, NULL); goto error; } - lex_force_match (lexer, ')'); + lex_force_match (lexer, T_RPAREN); } else if (lex_match_id (lexer, "CI")) { - lex_force_match (lexer, '('); + lex_force_match (lexer, T_LPAREN); lex_force_num (lexer); roc.ci = lex_number (lexer); lex_get (lexer); - lex_force_match (lexer, ')'); + lex_force_match (lexer, T_RPAREN); } else if (lex_match_id (lexer, "DISTRIBUTION")) { - lex_force_match (lexer, '('); + lex_force_match (lexer, T_LPAREN); if (lex_match_id (lexer, "FREE")) { roc.bi_neg_exp = false; @@ -253,7 +253,7 @@ cmd_roc (struct lexer *lexer, struct dataset *ds) lex_error (lexer, NULL); goto error; } - lex_force_match (lexer, ')'); + lex_force_match (lexer, T_RPAREN); } else {