/* PSPP - a program for statistical analysis.
   Copyright (C) 2006, 2009, 2010, 2011 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
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>. */

/* Utility commands acceptable anywhere. */
DEF_CMD (S_ANY, F_ENHANCED, "CLOSE FILE HANDLE", cmd_close_file_handle)
DEF_CMD (S_ANY, 0, "CACHE", cmd_cache)
DEF_CMD (S_ANY, 0, "CD", cmd_cd)
DEF_CMD (S_ANY, 0, "DATASET ACTIVATE", cmd_dataset_activate)
DEF_CMD (S_ANY, 0, "DATASET DECLARE", cmd_dataset_declare)
DEF_CMD (S_ANY, 0, "DATASET CLOSE", cmd_dataset_close)
DEF_CMD (S_ANY, 0, "DATASET COPY", cmd_dataset_copy)
DEF_CMD (S_ANY, 0, "DATASET NAME", cmd_dataset_name)
DEF_CMD (S_ANY, 0, "DATASET DISPLAY", cmd_dataset_display)
DEF_CMD (S_ANY, 0, "DO REPEAT", cmd_do_repeat)
DEF_CMD (S_ANY, 0, "END REPEAT", cmd_end_repeat)
DEF_CMD (S_ANY, 0, "ECHO", cmd_echo)
DEF_CMD (S_ANY, 0, "ERASE", cmd_erase)
DEF_CMD (S_ANY, 0, "EXIT", cmd_finish)
DEF_CMD (S_ANY, 0, "FILE HANDLE", cmd_file_handle)
DEF_CMD (S_ANY, 0, "FILE LABEL", cmd_file_label)
DEF_CMD (S_ANY, 0, "FINISH", cmd_finish)
DEF_CMD (S_ANY, 0, "HOST", cmd_host)
DEF_CMD (S_ANY, 0, "INCLUDE", cmd_include)
DEF_CMD (S_ANY, 0, "INSERT", cmd_insert)
DEF_CMD (S_ANY, 0, "N OF CASES", cmd_n_of_cases)
DEF_CMD (S_ANY, F_ABBREV, "N", cmd_n_of_cases)
DEF_CMD (S_ANY, 0, "NEW FILE", cmd_new_file)
DEF_CMD (S_ANY, 0, "PERMISSIONS", cmd_permissions)
DEF_CMD (S_ANY, 0, "PRESERVE", cmd_preserve)
DEF_CMD (S_ANY, F_ABBREV, "Q", cmd_finish)
DEF_CMD (S_ANY, 0, "QUIT", cmd_finish)
DEF_CMD (S_ANY, 0, "RESTORE", cmd_restore)
DEF_CMD (S_ANY, 0, "SET", cmd_set)
DEF_CMD (S_ANY, 0, "SHOW", cmd_show)
DEF_CMD (S_ANY, 0, "SUBTITLE", cmd_subtitle)
DEF_CMD (S_ANY, 0, "SYSFILE INFO", cmd_sysfile_info)
DEF_CMD (S_ANY, 0, "TITLE", cmd_title)

/* Commands that define (or replace) the active dataset. */
DEF_CMD (S_INITIAL | S_DATA, 0, "ADD FILES", cmd_add_files)
DEF_CMD (S_INITIAL | S_DATA | S_INPUT_PROGRAM | S_FILE_TYPE, 0, "DATA LIST", cmd_data_list)
DEF_CMD (S_INITIAL | S_DATA, 0, "GET", cmd_get)
DEF_CMD (S_INITIAL | S_DATA, 0, "GET DATA", cmd_get_data)
DEF_CMD (S_INITIAL | S_DATA, 0, "IMPORT", cmd_import)
DEF_CMD (S_INITIAL | S_DATA, 0, "INPUT PROGRAM", cmd_input_program)
DEF_CMD (S_INITIAL | S_DATA, 0, "MATCH FILES", cmd_match_files)
DEF_CMD (S_INITIAL | S_DATA, 0, "UPDATE", cmd_update)

/* Transformations and utilities that may appear after active
   file definition or within INPUT PROGRAM. */
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "ADD VALUE LABELS", cmd_add_value_labels)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "ADD DOCUMENT", cmd_add_documents)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "APPLY DICTIONARY", cmd_apply_dictionary)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "BREAK", cmd_break)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "COMPUTE", cmd_compute)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "DATAFILE ATTRIBUTE", cmd_datafile_attribute)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "DISPLAY", cmd_display)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "DOCUMENT", cmd_document)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "DO IF", cmd_do_if)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "DROP DOCUMENTS", cmd_drop_documents)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "ELSE IF", cmd_else_if)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "ELSE", cmd_else)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "END IF", cmd_end_if)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "END LOOP", cmd_end_loop)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "FORMATS", cmd_formats)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "IF", cmd_if)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "LEAVE", cmd_leave)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "LOOP", cmd_loop)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "MISSING VALUES", cmd_missing_values)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "MRSETS", cmd_mrsets)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "NUMERIC", cmd_numeric)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "PRINT EJECT", cmd_print_eject)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "PRINT FORMATS", cmd_print_formats)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "PRINT SPACE", cmd_print_space)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "PRINT", cmd_print)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "RECODE", cmd_recode)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "SELECT IF", cmd_select_if)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "SPLIT FILE", cmd_split_file)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "STRING", cmd_string)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "VALUE LABELS", cmd_value_labels)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "VARIABLE ALIGNMENT", cmd_variable_alignment)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "VARIABLE ATTRIBUTE", cmd_variable_attribute)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "VARIABLE LABELS", cmd_variable_labels)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "VARIABLE LEVEL", cmd_variable_level)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "VARIABLE WIDTH", cmd_variable_width)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "VECTOR", cmd_vector)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "WEIGHT", cmd_weight)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "WRITE FORMATS", cmd_write_formats)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "WRITE", cmd_write)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, F_ENHANCED, "XEXPORT", cmd_xexport)
DEF_CMD (S_DATA | S_INPUT_PROGRAM, 0, "XSAVE", cmd_xsave)

/* Commands that may appear after active dataset definition. */
DEF_CMD (S_DATA, 0, "AGGREGATE", cmd_aggregate)
DEF_CMD (S_DATA, 0, "AUTORECODE", cmd_autorecode)
DEF_CMD (S_DATA, 0, "BEGIN DATA", cmd_begin_data)
DEF_CMD (S_DATA, 0, "COUNT", cmd_count)
DEF_CMD (S_DATA, 0, "CROSSTABS", cmd_crosstabs)
DEF_CMD (S_DATA, 0, "CORRELATIONS", cmd_correlation)
DEF_CMD (S_DATA, 0, "DELETE VARIABLES", cmd_delete_variables)
DEF_CMD (S_DATA, 0, "DESCRIPTIVES", cmd_descriptives)
DEF_CMD (S_DATA, 0, "EXAMINE", cmd_examine)
DEF_CMD (S_DATA, 0, "EXECUTE", cmd_execute)
DEF_CMD (S_DATA, 0, "EXPORT", cmd_export)
DEF_CMD (S_DATA, 0, "FACTOR", cmd_factor)
DEF_CMD (S_DATA, 0, "FILTER", cmd_filter)
DEF_CMD (S_DATA, 0, "FLIP", cmd_flip)
DEF_CMD (S_DATA, 0, "FREQUENCIES", cmd_frequencies)
DEF_CMD (S_DATA, 0, "GLM", cmd_glm)
DEF_CMD (S_DATA, 0, "LIST", cmd_list)
DEF_CMD (S_DATA, 0, "MEANS", cmd_means)
DEF_CMD (S_DATA, 0, "MODIFY VARS", cmd_modify_vars)
DEF_CMD (S_DATA, 0, "NPAR TESTS", cmd_npar_tests)
DEF_CMD (S_DATA, 0, "ONEWAY", cmd_oneway)
DEF_CMD (S_DATA, 0, "PEARSON CORRELATIONS", cmd_correlation)
DEF_CMD (S_DATA, 0, "QUICK CLUSTER", cmd_quick_cluster)
DEF_CMD (S_DATA, 0, "RANK", cmd_rank)
DEF_CMD (S_DATA, 0, "REGRESSION",  cmd_regression)
DEF_CMD (S_DATA, 0, "RELIABILITY", cmd_reliability)
DEF_CMD (S_DATA, 0, "RENAME VARIABLES", cmd_rename_variables)
DEF_CMD (S_DATA, 0, "ROC", cmd_roc)
DEF_CMD (S_DATA, 0, "SAMPLE", cmd_sample)
DEF_CMD (S_DATA, 0, "SAVE", cmd_save)
DEF_CMD (S_DATA, 0, "SAVE TRANSLATE", cmd_save_translate)
DEF_CMD (S_DATA, 0, "SORT CASES", cmd_sort_cases)
DEF_CMD (S_DATA, 0, "T-TEST", cmd_t_test)
DEF_CMD (S_DATA, 0, "TEMPORARY", cmd_temporary)
DEF_CMD (S_DATA, 0, "USE", cmd_use)

/* Commands valid only with INPUT PROGRAM. */
DEF_CMD (S_INPUT_PROGRAM, 0, "END CASE", cmd_end_case)
DEF_CMD (S_INPUT_PROGRAM, 0, "END FILE", cmd_end_file)
DEF_CMD (S_INPUT_PROGRAM, 0, "END INPUT PROGRAM", cmd_end_input_program)
DEF_CMD (S_INPUT_PROGRAM, 0, "REREAD", cmd_reread)

/* Commands for testing PSPP. */
DEF_CMD (S_ANY, F_TESTING, "DEBUG EVALUATE", cmd_debug_evaluate)
DEF_CMD (S_ANY, F_TESTING, "DEBUG FORMAT GUESSER", cmd_debug_format_guesser)
DEF_CMD (S_ANY, F_TESTING, "DEBUG MOMENTS", cmd_debug_moments)
DEF_CMD (S_ANY, F_TESTING, "DEBUG PAPER SIZE", cmd_debug_paper_size)
DEF_CMD (S_ANY, F_TESTING, "DEBUG POOL", cmd_debug_pool)
DEF_CMD (S_ANY, F_TESTING, "DEBUG FLOAT FORMAT", cmd_debug_float_format)
DEF_CMD (S_ANY, F_TESTING, "DEBUG XFORM FAIL", cmd_debug_xform_fail)

/* Unimplemented commands. */
UNIMPL_CMD ("2SLS", "Two stage least squares regression")
UNIMPL_CMD ("ACF", "Autocorrelation function")
UNIMPL_CMD ("ALSCAL", "Multidimensional scaling")
UNIMPL_CMD ("ANACOR", "Correspondence analysis")
UNIMPL_CMD ("ANOVA", "Factorial analysis of variance")
UNIMPL_CMD ("CASEPLOT", "Plot time series")
UNIMPL_CMD ("CASESTOVARS", "Restructure complex data")
UNIMPL_CMD ("CATPCA", "Categorical principle components analysis")
UNIMPL_CMD ("CATREG", "Categorical regression")
UNIMPL_CMD ("CCF", "Time series cross correlation")
UNIMPL_CMD ("CLEAR TRANSFORMATIONS", "Clears transformations from active dataset")
UNIMPL_CMD ("CLUSTER", "Hierarchical clustering")
UNIMPL_CMD ("CONJOINT", "Analyse full concept data")
UNIMPL_CMD ("CORRESPONDENCE", "Show correspondence")
UNIMPL_CMD ("COXREG", "Cox proportional hazards regression")
UNIMPL_CMD ("CREATE", "Create time series data")
UNIMPL_CMD ("CSDESCRIPTIVES", "Complex samples descriptives")
UNIMPL_CMD ("CSGLM", "Complex samples GLM")
UNIMPL_CMD ("CSLOGISTIC", "Complex samples logistic regression")
UNIMPL_CMD ("CSPLAN", "Complex samples design")
UNIMPL_CMD ("CSSELECT", "Select complex samples")
UNIMPL_CMD ("CSTABULATE", "Tabulate complex samples")
UNIMPL_CMD ("CTABLES", "Display complex samples")
UNIMPL_CMD ("CURVEFIT", "Fit curve to line plot")
UNIMPL_CMD ("DATE", "Create time series data")
UNIMPL_CMD ("DEFINE", "Syntax macros")
UNIMPL_CMD ("DETECTANOMALY", "Find unusual cases")
UNIMPL_CMD ("DISCRIMINANT", "Linear discriminant analysis")
UNIMPL_CMD ("EDIT", "obsolete")
UNIMPL_CMD ("END FILE TYPE", "Ends complex data input")
UNIMPL_CMD ("FILE TYPE", "Complex data input")
UNIMPL_CMD ("FIT", "Goodness of Fit")
UNIMPL_CMD ("GENLOG", "Categorical model fitting")
UNIMPL_CMD ("GET TRANSLATE", "Read other file formats")
UNIMPL_CMD ("GGRAPH", "Custom defined graphs")
UNIMPL_CMD ("GRAPH", "Draw graphs")
UNIMPL_CMD ("HILOGLINEAR", "Hierarchical loglinear models")
UNIMPL_CMD ("HOMALS", "Homogeneity analysis")
UNIMPL_CMD ("IGRAPH", "Interactive graphs")
UNIMPL_CMD ("INFO", "Local Documentation")
UNIMPL_CMD ("KEYED DATA LIST", "Read nonsequential data")
UNIMPL_CMD ("KM", "Kaplan-Meier")
UNIMPL_CMD ("LOGISTIC REGRESSION", "Regression Analysis")
UNIMPL_CMD ("LOGLINEAR", "General model fitting")
UNIMPL_CMD ("MANOVA", "Multivariate analysis of variance")
UNIMPL_CMD ("MAPS", "Geographical display")
UNIMPL_CMD ("MATRIX", "Matrix processing")
UNIMPL_CMD ("MATRIX DATA", "Matrix data input")
UNIMPL_CMD ("MCONVERT", "Convert covariance/correlation matrices")
UNIMPL_CMD ("MIXED", "Mixed linear models")
UNIMPL_CMD ("MODEL CLOSE", "Close server connection")
UNIMPL_CMD ("MODEL HANDLE", "Define server connection")
UNIMPL_CMD ("MODEL LIST", "Show existing models")
UNIMPL_CMD ("MODEL NAME", "Specify model label")
UNIMPL_CMD ("MULTIPLE CORRESPONDENCE", "Multiple correspondence analysis")
UNIMPL_CMD ("MULT RESPONSE", "Multiple response analysis")
UNIMPL_CMD ("MVA", "Missing value analysis")
UNIMPL_CMD ("NAIVEBAYES", "Small sample bayesian prediction")
UNIMPL_CMD ("NLR", "Non Linear Regression")
UNIMPL_CMD ("NOMREG", "Multinomial logistic regression")
UNIMPL_CMD ("NONPAR CORR", "Nonparametric correlation")
UNIMPL_CMD ("NUMBERED", "")
UNIMPL_CMD ("OLAP CUBES", "On-line analytical processing")
UNIMPL_CMD ("OMS", "Output management")
UNIMPL_CMD ("ORTHOPLAN", "Orthogonal effects design")
UNIMPL_CMD ("OVERALS", "Nonlinear canonical correlation")
UNIMPL_CMD ("PACF", "Partial autocorrelation")
UNIMPL_CMD ("PARTIAL CORR", "Partial correlation")
UNIMPL_CMD ("PLANCARDS", "Conjoint analysis planning")
UNIMPL_CMD ("PLUM", "Estimate ordinal regression models")
UNIMPL_CMD ("POINT", "Marker in keyed file")
UNIMPL_CMD ("PPLOT", "Plot time series variables")
UNIMPL_CMD ("PREDICT", "Specify forecast period")
UNIMPL_CMD ("PREFSCAL", "Multidimensional unfolding")
UNIMPL_CMD ("PRINCALS", "PCA by alternating least squares")
UNIMPL_CMD ("PROBIT", "Probit analysis")
UNIMPL_CMD ("PROCEDURE OUTPUT", "Specify output file")
UNIMPL_CMD ("PROXIMITIES", "Pairwise similarity")
UNIMPL_CMD ("PROXSCAL", "Multidimensional scaling of proximity data")
UNIMPL_CMD ("RATIO STATISTICS", "Descriptives of ratios")
UNIMPL_CMD ("READ MODEL", "Read new model")
UNIMPL_CMD ("RECORD TYPE", "Defines a type of record within FILE TYPE")
UNIMPL_CMD ("REFORMAT", "Read obsolete files")
UNIMPL_CMD ("REPEATING DATA", "Specify multiple cases per input record")
UNIMPL_CMD ("REPORT", "Pretty print working file")
UNIMPL_CMD ("RMV", "Replace missing values")
UNIMPL_CMD ("SCRIPT", "Run script file")
UNIMPL_CMD ("SEASON", "Estimate seasonal factors")
UNIMPL_CMD ("SELECTPRED", "Select predictor variables")
UNIMPL_CMD ("SPCHART", "Plot control charts")
UNIMPL_CMD ("SPECTRA", "Plot spectral density")
UNIMPL_CMD ("SUMMARIZE", "Univariate statistics")
UNIMPL_CMD ("SURVIVAL", "Survival analysis")
UNIMPL_CMD ("TDISPLAY", "Display active models")
UNIMPL_CMD ("TREE", "Create classification tree")
UNIMPL_CMD ("TSAPPLY", "Apply time series model")
UNIMPL_CMD ("TSET", "Set time sequence variables")
UNIMPL_CMD ("TSHOW", "Show time sequence variables")
UNIMPL_CMD ("TSMODEL", "Estimate time series model")
UNIMPL_CMD ("TSPLOT", "Plot time sequence variables")
UNIMPL_CMD ("TWOSTEP CLUSTER", "Cluster observations")
UNIMPL_CMD ("UNIANOVA", "Univariate analysis")
UNIMPL_CMD ("UNNUMBERED", "obsolete")
UNIMPL_CMD ("VALIDATEDATA", "Identify suspicious cases")
UNIMPL_CMD ("VARCOMP", "Estimate variance")
UNIMPL_CMD ("VARSTOCASES", "Restructure complex data")
UNIMPL_CMD ("VERIFY", "Report time series")
UNIMPL_CMD ("WLS", "Weighted least squares regression")
UNIMPL_CMD ("XGRAPH", "High resolution charts")
