1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 1997-9, 2000, 2006, 2010, 2013 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* Command return values. */
25 /* Successful return values. */
26 CMD_SUCCESS = 1, /* Successfully parsed and executed. */
27 CMD_EOF = 2, /* End of input. */
28 CMD_FINISH = 3, /* FINISH was executed. */
30 /* Various kinds of failures. */
31 CMD_FAILURE = -1, /* Not executed at all. */
32 CMD_NOT_IMPLEMENTED = -2, /* Command not implemented. */
33 CMD_CASCADING_FAILURE = -3 /* Serious error: don't continue. */
36 bool cmd_result_is_success (enum cmd_result);
37 bool cmd_result_is_failure (enum cmd_result);
39 /* Command processing state. */
42 CMD_STATE_INITIAL, /* No active dataset yet defined. */
43 CMD_STATE_DATA, /* Active dataset has been defined. */
44 CMD_STATE_INPUT_PROGRAM, /* Inside INPUT PROGRAM. */
45 CMD_STATE_FILE_TYPE, /* Inside FILE TYPE. */
47 /* Inside LOOP or DO IF... */
48 CMD_STATE_NESTED_DATA, /* ...in CMD_STATE_DATA. */
49 CMD_STATE_NESTED_INPUT_PROGRAM, /* ...in CMD_STATE_INPUT_PROGRAM. */
55 enum cmd_result cmd_parse_in_state (struct lexer *lexer, struct dataset *ds,
58 enum cmd_result cmd_parse (struct lexer *lexer, struct dataset *ds);
61 const char *cmd_complete (const char *, const struct command **);
65 /* Prototype all the command functions. */
66 #define DEF_CMD(STATES, FLAGS, NAME, FUNCTION) int FUNCTION (struct lexer *, struct dataset *);
67 #define UNIMPL_CMD(NAME, DESCRIPTION)
68 #include "command.def"
72 #endif /* command.h */