Fix bug #11612, "q2c documentation does not agree with code".
authorBen Pfaff <blp@gnu.org>
Wed, 5 Jul 2006 05:14:30 +0000 (05:14 +0000)
committerBen Pfaff <blp@gnu.org>
Wed, 5 Jul 2006 05:14:30 +0000 (05:14 +0000)
Thanks to John Darrington for review.

15 files changed:
doc/q2c.texi
src/language/data-io/ChangeLog
src/language/data-io/list.q
src/language/lexer/ChangeLog
src/language/lexer/q2c.c
src/language/stats/ChangeLog
src/language/stats/correlations.q
src/language/stats/crosstabs.q
src/language/stats/examine.q
src/language/stats/frequencies.q
src/language/stats/means.q
src/language/stats/oneway.q
src/language/stats/rank.q
src/language/stats/regression.q
src/language/stats/t-test.q

index 8a4257c0d6f4fb7fcc778c49cae92142a70633a0..280c543a4bc5bde4436a5792d95eaecdb01bcd44 100644 (file)
@@ -123,13 +123,12 @@ separated by semicolons (@samp{;}) and terminated with a full stop
 (@samp{.}).
 
 @example
-subcommand ::= sbc-options ID sbc-defn
-sbc-options ::= 
-            ::= sbc-option
-            ::= sbc-options sbc-options
-sbc-option ::= *
-           ::= +
-           ::= ^
+subcommand ::= default-opt arity-opt ID sbc-defn
+default-opt ::=
+            ::= *
+arity-opt ::=
+          ::= +
+          ::= ^
 sbc-defn ::= opt-prefix = specifiers
          ::= [ ID ] = array-sbc
          ::= opt-prefix = sbc-special-form
@@ -137,16 +136,16 @@ opt-prefix ::=
            ::= ( ID )
 @end example
 
-Each subcommand can be prefixed with one or more option characters.  An
-asterisk (@samp{*}) is used to indicate the default subcommand; the
-keyword used for the default subcommand can be omitted in the PSPP
-syntax file.  A plus sign (@samp{+}) is used to indicate that a
-subcommand can appear more than once; if it is not present then that
-subcommand can appear no more than once.
-A carat sign (@samp{^}) is used to indicate that a subcommand must appear
-at least once.
+A subcommand that begins with an asterisk (@samp{*}) is the default
+subcommand.  The keyword used for the default subcommand can be omitted
+in the PSPP syntax file.
 
-The subcommand name appears after the option characters.
+A plus sign (@samp{+}) indicates that a subcommand can appear more than
+once.  A caret (@samp{^}) indicate that a subcommand must appear exactly
+once.  A subcommand marked with neither character may appear once or not
+at all, but not more than once.
+
+The subcommand name appears after the leading option characters.
 
 There are three forms of subcommands.  The first and most common form
 simply gives an equals sign (@samp{=}) and a list of specifiers, which
index 22d8e675bfab85e8565802d6cec413003409b439..d78105b8b53d8caa065eba6eb6b08ee7bd1a0411 100644 (file)
@@ -1,3 +1,10 @@
+Sat Jul  1 17:39:40 2006  Ben Pfaff  <blp@gnu.org>
+
+       Fix bug #11612, "q2c documentation does not agree with code".
+       
+       * list.q: Audit use of q2c "+" prefixes that indicate that a
+       command may appear multiple times.
+
 Sat Jul  1 20:44:22 2006  Ben Pfaff  <blp@gnu.org>
 
        Fix bug #15786: System File Creation crashes if directoy is
index cd5de5c33089a44678cbb29910e27e2358f68d89..19c1bb452efad2af92f77313f9375c29dba6abcb 100644 (file)
@@ -52,9 +52,9 @@
    list (lst_):
      *variables=varlist("PV_NO_SCRATCH");
      cases=:from n:first,"%s>0"/by n:step,"%s>0"/ *to n:last,"%s>0";
-     format=numbering:numbered/!unnumbered,
-            wrap:!wrap/single,
-            weight:weight/!noweight.
+     +format=numbering:numbered/!unnumbered,
+             wrap:!wrap/single,
+             weight:weight/!noweight.
 */
 /* (declarations) */
 /* (functions) */
index fbab8e4bb140f3e7cec3758a11de0b570b97bdf2..2bc5b87ef0f32ed9bce3573234cc77a35cec62f5 100644 (file)
@@ -1,3 +1,10 @@
+Sat Jul  1 17:40:38 2006  Ben Pfaff  <blp@gnu.org>
+
+       Fix bug #11612, "q2c documentation does not agree with code".
+       
+       * q2c.c (parse_subcommand): Make "+" mean ARITY_MANY, absence
+       mean ARITY_ONCE_ONLY.
+
 Tue Jul  4 09:45:12 2006  Ben Pfaff  <blp@gnu.org>
 
        Fix bug #15766 (/KEEP subcommand on SAVE doesn't fully support
index a62cf9171b30442fdc5adb4ebe2d075a76425b24..df6f5d9f3998443474fd0ef403da90c56ec6d2db 100644 (file)
@@ -739,8 +739,6 @@ parse_specifiers (subcommand *sbc)
 static void
 parse_subcommand (subcommand *sbc)
 {
-  sbc->arity = ARITY_MANY;
-
   if (match_token ('*'))
     {
       if (def)
@@ -748,8 +746,9 @@ parse_subcommand (subcommand *sbc)
       def = sbc;
     }
 
+  sbc->arity = ARITY_ONCE_ONLY;
   if ( match_token('+'))
-    sbc->arity = ARITY_ONCE_ONLY ;
+    sbc->arity = ARITY_MANY;
   else if (match_token('^'))
     sbc->arity = ARITY_ONCE_EXACTLY ;
 
index 3cce67c47d4341cccdf14b5f5221bbce2512e767..0a0abfb6fa41567928be8dd931df697de1090fab 100644 (file)
@@ -1,3 +1,18 @@
+Sat Jul  1 17:41:46 2006  Ben Pfaff  <blp@gnu.org>
+
+       Fix bug #11612, "q2c documentation does not agree with code".
+       
+       * examine.q: Audit use of q2c "+" prefixes that indicate that a
+       command may appear multiple times.
+
+       * frequencies.q: Ditto.
+
+       * oneway.q: Ditto.
+
+       * regression.q: Ditto.
+
+       * t-test.q: Ditto.
+
 Fri Jun 23 14:18:22 2006  Ben Pfaff  <blp@gnu.org>
 
        Support long string variables on FREQUENCIES, as
index 5ba91e5cd2a2cf98d82f9969716180ebdc4b4152..12d3645919d2eecf8600f0d25ce9358aae2a8f88 100644 (file)
@@ -59,8 +59,8 @@ cmd_correlations (void)
 /* (specification)
    "CORRELATIONS" (cor_):
      *variables=custom;
-     +missing=miss:!pairwise/listwise,
-             inc:include/exclude;
+     missing=miss:!pairwise/listwise,
+            inc:include/exclude;
      +print=tail:!twotail/onetail,
            sig:!sig/nosig;
      +format=fmt:!matrix/serial;
index 23b12a9d8af184a3f18091725e33c2959fc9d250..d13a14328449768115255cbcc17b0810100c84e1 100644 (file)
@@ -68,7 +68,7 @@
    crosstabs (crs_):
      *^tables=custom;
      +variables=custom;
-     +missing=miss:!table/include/report;
+     missing=miss:!table/include/report;
      +write[wr_]=none,cells,all;
      +format=fmt:!labels/nolabels/novallabs,
             val:!avalue/dvalue,
index 44e7125d29bf1b6846b11b1c1e0ceb607eb71f5a..c930cf01d3a54ecb3217d565230e0d827853bd30 100644 (file)
@@ -64,9 +64,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    *^variables=custom;
    +total=custom;
    +nototal=custom;
-   +missing=miss:pairwise/!listwise,
-   rep:report/!noreport,
-   incl:include/!exclude;
+   missing=miss:pairwise/!listwise,
+           rep:report/!noreport,
+           incl:include/!exclude;
    +compare=cmp:variables/!groups;
    +percentiles=custom;
    +id=var;
index 95041d5d80aa3fa059e967e811b4f073dccc2f60..5c3de42cac15096a53f9e1eb7b7e1b5cd8bd114b 100644 (file)
 
 /* (specification)
    FREQUENCIES (frq_):
-     *variables=custom;
-     format=cond:condense/onepage(*n:onepage_limit,"%s>=0")/!standard,
-           table:limit(n:limit,"%s>0")/notable/!table, 
-           labels:!labels/nolabels,
-           sort:!avalue/dvalue/afreq/dfreq,
-           spaces:!single/double,
-           paging:newpage/!oldpage;
+     *+variables=custom;
+     +format=cond:condense/onepage(*n:onepage_limit,"%s>=0")/!standard,
+            table:limit(n:limit,"%s>0")/notable/!table, 
+            labels:!labels/nolabels,
+            sort:!avalue/dvalue/afreq/dfreq,
+            spaces:!single/double,
+            paging:newpage/!oldpage;
      missing=miss:include/!exclude;
      barchart(ba_)=:minimum(d:min),
            :maximum(d:max),
            scale:freq(*n:freq,"%s>0")/percent(*n:pcnt,"%s>0"),
            norm:!nonormal/normal,
            incr:increment(d:inc,"%s>0");
-     grouped=custom;
-     ntiles=integer;
+     +grouped=custom;
+     +ntiles=integer;
      +percentiles = double list;
-     statistics[st_]=1|mean,2|semean,3|median,4|mode,5|stddev,6|variance,
-           7|kurtosis,8|skewness,9|range,10|minimum,11|maximum,12|sum,
-           13|default,14|seskewness,15|sekurtosis,all,none.
+     +statistics[st_]=1|mean,2|semean,3|median,4|mode,5|stddev,6|variance,
+           7|kurtosis,8|skewness,9|range,10|minimum,11|maximum,12|sum,
+           13|default,14|seskewness,15|sekurtosis,all,none.
 */
 /* (declarations) */
 /* (functions) */
index fb03f754518f1ede12c3f42bbc67a99afc14c125..8405ff3637d68697659e35da5ef62cfce5c6aa71 100644 (file)
@@ -44,7 +44,7 @@
             name:!names/nonames,
             val:!values/novalues,
             fmt:!table/tree;
-     +missing=miss:!table/include/dependent;
+     missing=miss:!table/include/dependent;
      +cells[cl_]=default,count,sum,mean,stddev,variance,all;
      +statistics[st_]=anova,linearity,all,none.
 */
index 674cf710f085f4cbbeb2b81f07537921af86e6d7..cda3c17b4bffcb96e7561f8ba96912c5a870bae2 100644 (file)
@@ -57,10 +57,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 /* (specification)
    "ONEWAY" (oneway_):
    *^variables=custom;
-   +missing=miss:!analysis/listwise,
-   incl:include/!exclude;
-   contrast= double list;
-   statistics[st_]=descriptives,homogeneity.
+   missing=miss:!analysis/listwise,
+           incl:include/!exclude;
+   +contrast= double list;
+   +statistics[st_]=descriptives,homogeneity.
 */
 /* (declarations) */
 /* (functions) */
index 7024304d0c6f686515be1c8f7508aed4bd58a99e..71eaeccb1102a05ac6d0281e3054eb18a606baf6 100644 (file)
@@ -47,7 +47,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    +n=custom;
    +savage=custom;
    +print=print:!yes/no;
-   +missing=miss:!exclude/include.
+   missing=miss:!exclude/include.
 */
 /* (declarations) */
 /* (functions) */
index 4078156863f34bcaaa37386a8cf046f2187f9395..4e82a9231c6062d6a73e46c96e9e97e0451a8db9 100644 (file)
 /* (specification)
    "REGRESSION" (regression_):
    *variables=custom;
-   statistics[st_]=r,
-   coeff,
-   anova,
-   outs,
-   zpp,
-   label,
-   sha,
-   ci,
-   bcov,
-   ses,
-   xtx,
-   collin,
-   tol,
-   selection,
-   f,
-   defaults,
-   all;
+   +statistics[st_]=r,
+                    coeff,
+                    anova,
+                    outs,
+                    zpp,
+                    label,
+                    sha,
+                    ci,
+                    bcov,
+                    ses,
+                    xtx,
+                    collin,
+                    tol,
+                    selection,
+                    f,
+                    defaults,
+                    all;
    export=custom;
    ^dependent=varlist;
-   save[sv_]=resid,pred;
-   method=enter.
+   +save[sv_]=resid,pred;
+   +method=enter.
 */
 /* (declarations) */
 /* (functions) */
index 5584df7d6031cf0eb3367f65f752001402ecb2cb..3116f625d94347243dcbf39b91d64c554fff76fb 100644 (file)
    "T-TEST" (tts_):
      +groups=custom;
      testval=double;
-     variables=varlist("PV_NO_SCRATCH | PV_NUMERIC");
-     pairs=custom;
-     +missing=miss:!analysis/listwise,
-             incl:include/!exclude;
-     format=fmt:!labels/nolabels;
+     +variables=varlist("PV_NO_SCRATCH | PV_NUMERIC");
+     +pairs=custom;
+     missing=miss:!analysis/listwise,
+            incl:include/!exclude;
+     +format=fmt:!labels/nolabels;
      criteria=:cin(d:criteria,"%s > 0. && %s < 1.").
 */
 /* (declarations) */