pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src/language data-io/file-handle.q data-io...


From: Ben Pfaff
Subject: [Pspp-cvs] pspp/src/language data-io/file-handle.q data-io...
Date: Wed, 28 Jun 2006 02:21:28 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Changes by:     Ben Pfaff <blp> 06/06/28 02:21:28

Modified files:
        src/language/data-io: file-handle.q list.q 
        src/language/lexer: ChangeLog q2c.c 
        src/language/stats: correlations.q crosstabs.q examine.q 
                            frequencies.q means.q oneway.q rank.q 
                            regression.q t-test.q 
        src/language/utilities: set.q 

Log message:
        Add aux data parameter to q2c parse_<command>() and custom parser
        functions.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/data-io/file-handle.q?cvsroot=pspp&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/data-io/list.q?cvsroot=pspp&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/lexer/ChangeLog?cvsroot=pspp&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/lexer/q2c.c?cvsroot=pspp&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/correlations.q?cvsroot=pspp&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/crosstabs.q?cvsroot=pspp&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/examine.q?cvsroot=pspp&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/frequencies.q?cvsroot=pspp&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/means.q?cvsroot=pspp&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/oneway.q?cvsroot=pspp&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/rank.q?cvsroot=pspp&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/regression.q?cvsroot=pspp&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/t-test.q?cvsroot=pspp&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/utilities/set.q?cvsroot=pspp&r1=1.8&r2=1.9

Patches:
Index: data-io/file-handle.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/file-handle.q,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- data-io/file-handle.q       9 Jun 2006 22:51:24 -0000       1.5
+++ data-io/file-handle.q       28 Jun 2006 02:21:28 -0000      1.6
@@ -75,7 +75,7 @@
   if (!lex_force_match ('/'))
     return CMD_CASCADING_FAILURE;
 
-  if (!parse_file_handle (&cmd))
+  if (!parse_file_handle (&cmd, NULL))
     return CMD_CASCADING_FAILURE;
 
   if (lex_end_of_command () != CMD_SUCCESS)

Index: data-io/list.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/list.q,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- data-io/list.q      9 Jun 2006 22:51:24 -0000       1.12
+++ data-io/list.q      28 Jun 2006 02:21:28 -0000      1.13
@@ -134,7 +134,7 @@
   struct variable casenum_var;
   bool ok;
 
-  if (!parse_list (&cmd))
+  if (!parse_list (&cmd, NULL))
     return CMD_FAILURE;
   
   /* Fill in defaults. */

Index: lexer/ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/lexer/ChangeLog,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- lexer/ChangeLog     27 Jun 2006 19:09:22 -0000      1.8
+++ lexer/ChangeLog     28 Jun 2006 02:21:28 -0000      1.9
@@ -1,3 +1,16 @@
+Tue Jun 27 19:15:33 2006  Ben Pfaff  <address@hidden>
+
+       Add auxiliary data pointer to q2c parse_<command> function, and
+       pass it along to the custom parser functions.
+
+       Updated all uses of custom functions in all the existing .q files.
+       
+       * q2c.c (dump_declarations): Include auxiliary parameter in
+       function prototypes.
+       (dump_subcommand) Include aux arg in calls to custom functions.
+       (dump_parser) Include aux param in parse_<command> function
+       definition.  Include aux arg in calls to custom functions.
+
 Tue Jun 27 12:07:34 2006  Ben Pfaff  <address@hidden>
 
        * variable-parser.h: New header.  Moved the var_set and variable

Index: lexer/q2c.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/lexer/q2c.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- lexer/q2c.c 27 Jun 2006 19:09:22 -0000      1.11
+++ lexer/q2c.c 28 Jun 2006 02:21:28 -0000      1.12
@@ -1177,7 +1177,7 @@
              dump (0, "/* Prototype for custom subcommands of %s. */",
                    cmdname);
            }
-         dump (0, "static int %scustom_%s (struct cmd_%s *);",
+         dump (0, "static int %scustom_%s (struct cmd_%s *, void *);",
                st_lower (prefix), st_lower (sbc->name),
                make_identifier (cmdname));
        }
@@ -1189,7 +1189,7 @@
   /* Prototypes for parsing and freeing functions. */
   {
     dump (0, "/* Command parsing functions. */");
-    dump (0, "static int parse_%s (struct cmd_%s *);",
+    dump (0, "static int parse_%s (struct cmd_%s *, void *);",
          make_identifier (cmdname), make_identifier (cmdname));
     dump (0, "static void free_%s (struct cmd_%s *);",
          make_identifier (cmdname), make_identifier (cmdname));
@@ -1696,7 +1696,7 @@
     }
   else if (sbc->type == SBC_CUSTOM)
     {
-      dump (1, "switch (%scustom_%s (p))",
+      dump (1, "switch (%scustom_%s (p, aux))",
            st_lower (prefix), st_lower (sbc->name));
       dump (0, "{");
       dump (1, "case 0:");
@@ -1725,7 +1725,8 @@
   indent = 0;
 
   dump (0, "static int");
-  dump (0, "parse_%s (struct cmd_%s *p)", make_identifier (cmdname),
+  dump (0, "parse_%s (struct cmd_%s *p, void *aux UNUSED)",
+        make_identifier (cmdname),
        make_identifier (cmdname));
   dump (1, "{");
 
@@ -1761,7 +1762,7 @@
     }
   else if (def && def->type == SBC_CUSTOM)
     {
-      dump (1, "switch (%scustom_%s (p))",
+      dump (1, "switch (%scustom_%s (p, aux))",
            st_lower (prefix), st_lower (def->name));
       dump (0, "{");
       dump (1, "case 0:");

Index: stats/correlations.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/correlations.q,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- stats/correlations.q        27 Jun 2006 19:09:22 -0000      1.8
+++ stats/correlations.q        28 Jun 2006 02:21:28 -0000      1.9
@@ -78,7 +78,7 @@
   cor_list = cor_last = NULL;
   matrix_file = NULL;
 
-  if (!parse_correlations (&cmd))
+  if (!parse_correlations (&cmd, NULL))
     return CMD_FAILURE;
   free_correlations (&cmd);
 
@@ -86,7 +86,7 @@
 }
 
 static int
-cor_custom_variables (struct cmd_correlations *cmd UNUSED)
+cor_custom_variables (struct cmd_correlations *cmd UNUSED, void *aux UNUSED)
 {
   struct variable **v1, **v2;
   size_t nv1, nv2;
@@ -133,7 +133,7 @@
 }
 
 static int
-cor_custom_matrix (struct cmd_correlations *cmd UNUSED)
+cor_custom_matrix (struct cmd_correlations *cmd UNUSED, void *aux UNUSED)
 {
   if (!lex_force_match ('('))
     return 0;

Index: stats/crosstabs.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/crosstabs.q,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- stats/crosstabs.q   27 Jun 2006 19:09:22 -0000      1.10
+++ stats/crosstabs.q   28 Jun 2006 02:21:28 -0000      1.11
@@ -211,7 +211,7 @@
   pl_tc = pool_create ();
   pl_col = pool_create ();
 
-  if (!parse_crosstabs (&cmd))
+  if (!parse_crosstabs (&cmd, NULL))
     return CMD_FAILURE;
 
   mode = variables ? INTEGER : GENERAL;
@@ -301,7 +301,7 @@
 
 /* Parses the TABLES subcommand. */
 static int
-crs_custom_tables (struct cmd_crosstabs *cmd UNUSED)
+crs_custom_tables (struct cmd_crosstabs *cmd UNUSED, void *aux UNUSED)
 {
   struct var_set *var_set;
   int n_by;
@@ -405,7 +405,7 @@
 
 /* Parses the VARIABLES subcommand. */
 static int
-crs_custom_variables (struct cmd_crosstabs *cmd UNUSED)
+crs_custom_variables (struct cmd_crosstabs *cmd UNUSED, void *aux UNUSED)
 {
   if (nxtab)
     {

Index: stats/examine.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/examine.q,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- stats/examine.q     6 May 2006 17:46:52 -0000       1.7
+++ stats/examine.q     28 Jun 2006 02:21:28 -0000      1.8
@@ -198,7 +198,7 @@
   subc_list_double_create(&percentile_list);
   percentile_algorithm = PC_HAVERAGE;
 
-  if ( !parse_examine(&cmd) )
+  if ( !parse_examine(&cmd, NULL) )
     return CMD_FAILURE;
 
   /* If /MISSING=INCLUDE is set, then user missing values are ignored */
@@ -423,7 +423,7 @@
 
 /* Parse the PERCENTILES subcommand */
 static int
-xmn_custom_percentiles(struct cmd_examine *p UNUSED)
+xmn_custom_percentiles(struct cmd_examine *p UNUSED, void *aux UNUSED)
 {
   sbc_percentile = 1;
 
@@ -478,7 +478,7 @@
 
 /* TOTAL and NOTOTAL are simple, mutually exclusive flags */
 static int
-xmn_custom_total(struct cmd_examine *p)
+xmn_custom_total(struct cmd_examine *p, void *aux UNUSED)
 {
   if ( p->sbc_nototal ) 
     {
@@ -490,7 +490,7 @@
 }
 
 static int
-xmn_custom_nototal(struct cmd_examine *p)
+xmn_custom_nototal(struct cmd_examine *p, void *aux UNUSED)
 {
   if ( p->sbc_total ) 
     {
@@ -506,7 +506,7 @@
 /* Parser for the variables sub command  
    Returns 1 on success */
 static int
-xmn_custom_variables(struct cmd_examine *cmd )
+xmn_custom_variables(struct cmd_examine *cmd, void *aux UNUSED)
 {
   lex_match('=');
 

Index: stats/frequencies.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/frequencies.q,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- stats/frequencies.q 23 Jun 2006 21:30:11 -0000      1.10
+++ stats/frequencies.q 28 Jun 2006 02:21:28 -0000      1.11
@@ -335,7 +335,7 @@
   n_variables = 0;
   v_variables = NULL;
 
-  if (!parse_frequencies (&cmd))
+  if (!parse_frequencies (&cmd, NULL))
     return CMD_FAILURE;
 
   if (cmd.onepage_limit == NOT_LONG)
@@ -791,7 +791,7 @@
 /* Parses the VARIABLES subcommand, adding to
    {n_variables,v_variables}. */
 static int
-frq_custom_variables (struct cmd_frequencies *cmd UNUSED)
+frq_custom_variables (struct cmd_frequencies *cmd UNUSED, void *aux UNUSED)
 {
   int mode;
   int min = 0, max = 0;
@@ -879,7 +879,7 @@
 /* Parses the GROUPED subcommand, setting the n_grouped, grouped
    fields of specified variables. */
 static int
-frq_custom_grouped (struct cmd_frequencies *cmd UNUSED)
+frq_custom_grouped (struct cmd_frequencies *cmd UNUSED, void *aux UNUSED)
 {
   lex_match ('=');
   if ((token == T_ID && dict_lookup_var (default_dict, tokid) != NULL)

Index: stats/means.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/means.q,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- stats/means.q       5 May 2006 04:53:13 -0000       1.5
+++ stats/means.q       28 Jun 2006 02:21:28 -0000      1.6
@@ -72,7 +72,7 @@
   v_dim = NULL;
   v_var = NULL;
 
-  if (!parse_means (&cmd))
+  if (!parse_means (&cmd, NULL))
     goto free;
 
   if (cmd.sbc_cells)
@@ -123,7 +123,7 @@
 
 /* Parses the TABLES subcommand. */
 static int
-mns_custom_tables (struct cmd_means *cmd)
+mns_custom_tables (struct cmd_means *cmd, void *aux UNUSED)
 {
   struct var_set *var_set;
   

Index: stats/oneway.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/oneway.q,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- stats/oneway.q      6 May 2006 17:46:52 -0000       1.7
+++ stats/oneway.q      28 Jun 2006 02:21:28 -0000      1.8
@@ -121,7 +121,7 @@
   int i;
   bool ok;
 
-  if ( !parse_oneway(&cmd) )
+  if ( !parse_oneway(&cmd, NULL) )
     return CMD_FAILURE;
 
   /* If /MISSING=INCLUDE is set, then user missing values are ignored */
@@ -223,7 +223,7 @@
 
 /* Parser for the variables sub command */
 static int
-oneway_custom_variables(struct cmd_oneway *cmd UNUSED)
+oneway_custom_variables(struct cmd_oneway *cmd UNUSED, void *aux UNUSED)
 {
 
   lex_match('=');

Index: stats/rank.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/rank.q,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- stats/rank.q        5 May 2006 04:53:13 -0000       1.8
+++ stats/rank.q        28 Jun 2006 02:21:28 -0000      1.9
@@ -95,7 +95,7 @@
   size_t i;
   n_rank_specs = 0;
 
-  if ( !parse_rank(&cmd) )
+  if ( !parse_rank(&cmd, NULL) )
     return CMD_FAILURE;
 
 #if 1
@@ -139,7 +139,7 @@
 /* Parser for the variables sub command  
    Returns 1 on success */
 static int
-rank_custom_variables(struct cmd_rank *cmd UNUSED)
+rank_custom_variables(struct cmd_rank *cmd UNUSED, void *aux UNUSED)
 {
   static const int terminators[2] = {T_BY, 0};
 
@@ -298,50 +298,50 @@
 
 
 static int
-rank_custom_rank(struct cmd_rank *cmd )
+rank_custom_rank(struct cmd_rank *cmd, void *aux UNUSED )
 {
   return parse_rank_function(cmd, RANK);
 }
 
 static int
-rank_custom_normal(struct cmd_rank *cmd )
+rank_custom_normal(struct cmd_rank *cmd, void *aux UNUSED )
 {
   return parse_rank_function(cmd, NORMAL);
 }
 
 static int
-rank_custom_percent(struct cmd_rank *cmd )
+rank_custom_percent(struct cmd_rank *cmd, void *aux UNUSED )
 {
   return parse_rank_function(cmd, NORMAL);
 }
 
 static int
-rank_custom_rfraction(struct cmd_rank *cmd )
+rank_custom_rfraction(struct cmd_rank *cmd, void *aux UNUSED )
 {
   return parse_rank_function(cmd, RFRACTION);
 }
 
 static int
-rank_custom_proportion(struct cmd_rank *cmd )
+rank_custom_proportion(struct cmd_rank *cmd, void *aux UNUSED )
 {
   return parse_rank_function(cmd, PROPORTION);
 }
 
 static int
-rank_custom_n(struct cmd_rank *cmd )
+rank_custom_n(struct cmd_rank *cmd, void *aux UNUSED )
 {
   return parse_rank_function(cmd, N);
 }
 
 static int
-rank_custom_savage(struct cmd_rank *cmd )
+rank_custom_savage(struct cmd_rank *cmd, void *aux UNUSED )
 {
   return parse_rank_function(cmd, SAVAGE);
 }
 
 
 static int
-rank_custom_ntiles(struct cmd_rank *cmd )
+rank_custom_ntiles(struct cmd_rank *cmd, void *aux UNUSED )
 {
   if ( lex_force_match('(') ) 
     {

Index: stats/regression.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/regression.q,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- stats/regression.q  19 May 2006 21:08:20 -0000      1.26
+++ stats/regression.q  28 Jun 2006 02:21:28 -0000      1.27
@@ -908,7 +908,7 @@
     }
 }
 static int
-regression_custom_export (struct cmd_regression *cmd UNUSED)
+regression_custom_export (struct cmd_regression *cmd UNUSED, void *aux UNUSED)
 {
   /* 0 on failure, 1 on success, 2 on failure that should result in syntax 
error */
   if (!lex_force_match ('('))
@@ -932,7 +932,7 @@
 int
 cmd_regression (void)
 {
-  if (!parse_regression (&cmd))
+  if (!parse_regression (&cmd, NULL))
     return CMD_FAILURE;
 
   models = xnmalloc (cmd.n_dependent, sizeof *models);
@@ -996,7 +996,8 @@
 
 /* Parser for the variables sub command */
 static int
-regression_custom_variables (struct cmd_regression *cmd UNUSED)
+regression_custom_variables (struct cmd_regression *cmd UNUSED,
+                             void *aux UNUSED)
 {
 
   lex_match ('=');

Index: stats/t-test.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/t-test.q,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- stats/t-test.q      9 Jun 2006 22:51:24 -0000       1.7
+++ stats/t-test.q      28 Jun 2006 02:21:28 -0000      1.8
@@ -259,7 +259,7 @@
 {
   bool ok;
   
-  if ( !parse_t_test(&cmd) )
+  if ( !parse_t_test(&cmd, NULL) )
     return CMD_FAILURE;
 
   if (! cmd.sbc_criteria)
@@ -366,7 +366,7 @@
 }
 
 static int
-tts_custom_groups (struct cmd_t_test *cmd UNUSED)
+tts_custom_groups (struct cmd_t_test *cmd UNUSED, void *aux UNUSED)
 {
   int n_group_values=0;
 
@@ -445,7 +445,7 @@
 
 
 static int
-tts_custom_pairs (struct cmd_t_test *cmd UNUSED)
+tts_custom_pairs (struct cmd_t_test *cmd UNUSED, void *aux UNUSED)
 {
   struct variable **vars;
   size_t n_vars;

Index: utilities/set.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/utilities/set.q,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- utilities/set.q     5 May 2006 04:53:13 -0000       1.8
+++ utilities/set.q     28 Jun 2006 02:21:28 -0000      1.9
@@ -122,7 +122,7 @@
   struct cmd_set cmd;
   bool ok = true;
 
-  if (!parse_set (&cmd))
+  if (!parse_set (&cmd, NULL))
     return CMD_FAILURE;
 
   if (cmd.sbc_cca)
@@ -286,7 +286,7 @@
    completely blank fields in numeric data imply.  X, Wnd: Syntax is
    SYSMIS or a numeric value. */
 static int
-stc_custom_blanks (struct cmd_set *cmd UNUSED)
+stc_custom_blanks (struct cmd_set *cmd UNUSED, void *aux UNUSED)
 {
   lex_match ('=');
   if ((token == T_ID && lex_id_match ("SYSMIS", tokid)))
@@ -307,7 +307,7 @@
 /* Parses the EPOCH subcommand, which controls the epoch used for
    parsing 2-digit years. */
 static int
-stc_custom_epoch (struct cmd_set *cmd UNUSED) 
+stc_custom_epoch (struct cmd_set *cmd UNUSED, void *aux UNUSED) 
 {
   lex_match ('=');
   if (lex_match_id ("AUTOMATIC"))
@@ -333,7 +333,7 @@
 }
 
 static int
-stc_custom_length (struct cmd_set *cmd UNUSED)
+stc_custom_length (struct cmd_set *cmd UNUSED, void *aux UNUSED)
 {
   int page_length;
 
@@ -360,7 +360,7 @@
 }
 
 static int
-stc_custom_seed (struct cmd_set *cmd UNUSED)
+stc_custom_seed (struct cmd_set *cmd UNUSED, void *aux UNUSED)
 {
   lex_match ('=');
   if (lex_match_id ("RANDOM"))
@@ -377,7 +377,7 @@
 }
 
 static int
-stc_custom_width (struct cmd_set *cmd UNUSED)
+stc_custom_width (struct cmd_set *cmd UNUSED, void *aux UNUSED)
 {
   lex_match ('=');
   if (lex_match_id ("NARROW"))
@@ -403,7 +403,7 @@
 /* Parses FORMAT subcommand, which consists of a numeric format
    specifier. */
 static int
-stc_custom_format (struct cmd_set *cmd UNUSED)
+stc_custom_format (struct cmd_set *cmd UNUSED, void *aux UNUSED)
 {
   struct fmt_spec fmt;
 
@@ -423,7 +423,7 @@
 }
 
 static int
-stc_custom_journal (struct cmd_set *cmd UNUSED)
+stc_custom_journal (struct cmd_set *cmd UNUSED, void *aux UNUSED)
 {
   lex_match ('=');
   if (!lex_match_id ("ON") && !lex_match_id ("OFF")) 
@@ -440,7 +440,7 @@
 }
 
 static int
-stc_custom_listing (struct cmd_set *cmd UNUSED)
+stc_custom_listing (struct cmd_set *cmd UNUSED, void *aux UNUSED)
 {
   bool listing;
 
@@ -460,9 +460,9 @@
 }
 
 static int
-stc_custom_disk (struct cmd_set *cmd UNUSED)
+stc_custom_disk (struct cmd_set *cmd UNUSED, void *aux)
 {
-  return stc_custom_listing (cmd);
+  return stc_custom_listing (cmd, aux);
 }
 
 static void




reply via email to

[Prev in Thread] Current Thread [Next in Thread]