More clean up, update readme
authorJakub Skoczen <jakub@indexdata.dk>
Sat, 15 Mar 2014 15:08:37 +0000 (16:08 +0100)
committerJakub Skoczen <jakub@indexdata.dk>
Sat, 15 Mar 2014 15:08:37 +0000 (16:08 +0100)
212 files changed:
Changes
README
VERSION
src/main/java/org/z3950/zing/cql/CQLLexer.java
test/random/Makefile [deleted file]
test/random/README [deleted file]
test/random/mkrandom [deleted file]
test/regression/Makefile [deleted file]
test/regression/README [deleted file]
test/regression/mkanswers [deleted file]
test/regression/mktests [deleted file]
test/regression/queries.raw [deleted file]
test/regression/runcanon [deleted file]
test/regression/runtests [deleted file]
test/regression/sections/01/.gitignore [deleted file]
test/regression/sections/01/01.xcql [deleted file]
test/regression/sections/01/02.xcql [deleted file]
test/regression/sections/01/03.xcql [deleted file]
test/regression/sections/01/04.xcql [deleted file]
test/regression/sections/01/05.xcql [deleted file]
test/regression/sections/01/06.xcql [deleted file]
test/regression/sections/01/07.xcql [deleted file]
test/regression/sections/01/08.xcql [deleted file]
test/regression/sections/01/09.xcql [deleted file]
test/regression/sections/01/10.xcql [deleted file]
test/regression/sections/01/11.xcql [deleted file]
test/regression/sections/02/.gitignore [deleted file]
test/regression/sections/02/01.xcql [deleted file]
test/regression/sections/02/02.xcql [deleted file]
test/regression/sections/02/03.xcql [deleted file]
test/regression/sections/02/04.xcql [deleted file]
test/regression/sections/02/05.xcql [deleted file]
test/regression/sections/02/06.xcql [deleted file]
test/regression/sections/02/07.xcql [deleted file]
test/regression/sections/02/08.xcql [deleted file]
test/regression/sections/02/09.xcql [deleted file]
test/regression/sections/02/10.xcql [deleted file]
test/regression/sections/02/11.xcql [deleted file]
test/regression/sections/02/12.xcql [deleted file]
test/regression/sections/02/13.xcql [deleted file]
test/regression/sections/02/14.xcql [deleted file]
test/regression/sections/02/15.xcql [deleted file]
test/regression/sections/02/16.xcql [deleted file]
test/regression/sections/02/17.xcql [deleted file]
test/regression/sections/03/.gitignore [deleted file]
test/regression/sections/03/01.xcql [deleted file]
test/regression/sections/03/02.xcql [deleted file]
test/regression/sections/03/03.xcql [deleted file]
test/regression/sections/03/04.xcql [deleted file]
test/regression/sections/03/05.xcql [deleted file]
test/regression/sections/03/06.xcql [deleted file]
test/regression/sections/03/07.xcql [deleted file]
test/regression/sections/03/08.xcql [deleted file]
test/regression/sections/03/09.xcql [deleted file]
test/regression/sections/04/.gitignore [deleted file]
test/regression/sections/04/01.xcql [deleted file]
test/regression/sections/04/02.xcql [deleted file]
test/regression/sections/05/.gitignore [deleted file]
test/regression/sections/05/01.xcql [deleted file]
test/regression/sections/05/02.xcql [deleted file]
test/regression/sections/05/03.xcql [deleted file]
test/regression/sections/05/04.xcql [deleted file]
test/regression/sections/05/05.xcql [deleted file]
test/regression/sections/05/06.xcql [deleted file]
test/regression/sections/05/07.xcql [deleted file]
test/regression/sections/05/08.xcql [deleted file]
test/regression/sections/05/09.xcql [deleted file]
test/regression/sections/06/.gitignore [deleted file]
test/regression/sections/06/01.xcql [deleted file]
test/regression/sections/06/02.xcql [deleted file]
test/regression/sections/06/03.xcql [deleted file]
test/regression/sections/06/04.xcql [deleted file]
test/regression/sections/06/05.xcql [deleted file]
test/regression/sections/06/06.xcql [deleted file]
test/regression/sections/07/.gitignore [deleted file]
test/regression/sections/07/01.xcql [deleted file]
test/regression/sections/07/02.xcql [deleted file]
test/regression/sections/07/03.xcql [deleted file]
test/regression/sections/08/.gitignore [deleted file]
test/regression/sections/08/01.xcql [deleted file]
test/regression/sections/08/02.xcql [deleted file]
test/regression/sections/08/03.xcql [deleted file]
test/regression/sections/09/.gitignore [deleted file]
test/regression/sections/09/01.xcql [deleted file]
test/regression/sections/09/02.xcql [deleted file]
test/regression/sections/09/03.xcql [deleted file]
test/regression/sections/09/04.xcql [deleted file]
test/regression/sections/09/05.xcql [deleted file]
test/regression/sections/09/06.xcql [deleted file]
test/regression/sections/10/.gitignore [deleted file]
test/regression/sections/10/01.xcql [deleted file]
test/regression/sections/10/02.xcql [deleted file]
test/regression/sections/10/03.xcql [deleted file]
test/regression/sections/10/04.xcql [deleted file]
test/regression/sections/10/05.xcql [deleted file]
test/regression/sections/10/06.xcql [deleted file]
test/regression/sections/10/07.xcql [deleted file]
test/regression/sections/10/08.xcql [deleted file]
test/regression/sections/10/09.xcql [deleted file]
test/regression/sections/10/10.xcql [deleted file]
test/regression/sections/10/11.xcql [deleted file]
test/regression/sections/10/12.xcql [deleted file]
test/regression/sections/10/13.xcql [deleted file]
test/regression/sections/10/14.xcql [deleted file]
test/regression/sections/10/15.xcql [deleted file]
test/regression/sections/10/16.xcql [deleted file]
test/regression/showtest [deleted file]
test/regression/xmlpp.pl [deleted file]
util/random/Makefile [new file with mode: 0644]
util/random/README [new file with mode: 0644]
util/random/mkrandom [new file with mode: 0755]
util/regression/Makefile [new file with mode: 0644]
util/regression/README [new file with mode: 0644]
util/regression/mkanswers [new file with mode: 0755]
util/regression/mktests [new file with mode: 0755]
util/regression/queries.raw [new file with mode: 0644]
util/regression/runcanon [new file with mode: 0755]
util/regression/runtests [new file with mode: 0755]
util/regression/sections/01/.gitignore [new file with mode: 0644]
util/regression/sections/01/01.xcql [new file with mode: 0644]
util/regression/sections/01/02.xcql [new file with mode: 0644]
util/regression/sections/01/03.xcql [new file with mode: 0644]
util/regression/sections/01/04.xcql [new file with mode: 0644]
util/regression/sections/01/05.xcql [new file with mode: 0644]
util/regression/sections/01/06.xcql [new file with mode: 0644]
util/regression/sections/01/07.xcql [new file with mode: 0644]
util/regression/sections/01/08.xcql [new file with mode: 0644]
util/regression/sections/01/09.xcql [new file with mode: 0644]
util/regression/sections/01/10.xcql [new file with mode: 0644]
util/regression/sections/01/11.xcql [new file with mode: 0644]
util/regression/sections/02/.gitignore [new file with mode: 0644]
util/regression/sections/02/01.xcql [new file with mode: 0644]
util/regression/sections/02/02.xcql [new file with mode: 0644]
util/regression/sections/02/03.xcql [new file with mode: 0644]
util/regression/sections/02/04.xcql [new file with mode: 0644]
util/regression/sections/02/05.xcql [new file with mode: 0644]
util/regression/sections/02/06.xcql [new file with mode: 0644]
util/regression/sections/02/07.xcql [new file with mode: 0644]
util/regression/sections/02/08.xcql [new file with mode: 0644]
util/regression/sections/02/09.xcql [new file with mode: 0644]
util/regression/sections/02/10.xcql [new file with mode: 0644]
util/regression/sections/02/11.xcql [new file with mode: 0644]
util/regression/sections/02/12.xcql [new file with mode: 0644]
util/regression/sections/02/13.xcql [new file with mode: 0644]
util/regression/sections/02/14.xcql [new file with mode: 0644]
util/regression/sections/02/15.xcql [new file with mode: 0644]
util/regression/sections/02/16.xcql [new file with mode: 0644]
util/regression/sections/02/17.xcql [new file with mode: 0644]
util/regression/sections/03/.gitignore [new file with mode: 0644]
util/regression/sections/03/01.xcql [new file with mode: 0644]
util/regression/sections/03/02.xcql [new file with mode: 0644]
util/regression/sections/03/03.xcql [new file with mode: 0644]
util/regression/sections/03/04.xcql [new file with mode: 0644]
util/regression/sections/03/05.xcql [new file with mode: 0644]
util/regression/sections/03/06.xcql [new file with mode: 0644]
util/regression/sections/03/07.xcql [new file with mode: 0644]
util/regression/sections/03/08.xcql [new file with mode: 0644]
util/regression/sections/03/09.xcql [new file with mode: 0644]
util/regression/sections/04/.gitignore [new file with mode: 0644]
util/regression/sections/04/01.xcql [new file with mode: 0644]
util/regression/sections/04/02.xcql [new file with mode: 0644]
util/regression/sections/05/.gitignore [new file with mode: 0644]
util/regression/sections/05/01.xcql [new file with mode: 0644]
util/regression/sections/05/02.xcql [new file with mode: 0644]
util/regression/sections/05/03.xcql [new file with mode: 0644]
util/regression/sections/05/04.xcql [new file with mode: 0644]
util/regression/sections/05/05.xcql [new file with mode: 0644]
util/regression/sections/05/06.xcql [new file with mode: 0644]
util/regression/sections/05/07.xcql [new file with mode: 0644]
util/regression/sections/05/08.xcql [new file with mode: 0644]
util/regression/sections/05/09.xcql [new file with mode: 0644]
util/regression/sections/06/.gitignore [new file with mode: 0644]
util/regression/sections/06/01.xcql [new file with mode: 0644]
util/regression/sections/06/02.xcql [new file with mode: 0644]
util/regression/sections/06/03.xcql [new file with mode: 0644]
util/regression/sections/06/04.xcql [new file with mode: 0644]
util/regression/sections/06/05.xcql [new file with mode: 0644]
util/regression/sections/06/06.xcql [new file with mode: 0644]
util/regression/sections/07/.gitignore [new file with mode: 0644]
util/regression/sections/07/01.xcql [new file with mode: 0644]
util/regression/sections/07/02.xcql [new file with mode: 0644]
util/regression/sections/07/03.xcql [new file with mode: 0644]
util/regression/sections/08/.gitignore [new file with mode: 0644]
util/regression/sections/08/01.xcql [new file with mode: 0644]
util/regression/sections/08/02.xcql [new file with mode: 0644]
util/regression/sections/08/03.xcql [new file with mode: 0644]
util/regression/sections/09/.gitignore [new file with mode: 0644]
util/regression/sections/09/01.xcql [new file with mode: 0644]
util/regression/sections/09/02.xcql [new file with mode: 0644]
util/regression/sections/09/03.xcql [new file with mode: 0644]
util/regression/sections/09/04.xcql [new file with mode: 0644]
util/regression/sections/09/05.xcql [new file with mode: 0644]
util/regression/sections/09/06.xcql [new file with mode: 0644]
util/regression/sections/10/.gitignore [new file with mode: 0644]
util/regression/sections/10/01.xcql [new file with mode: 0644]
util/regression/sections/10/02.xcql [new file with mode: 0644]
util/regression/sections/10/03.xcql [new file with mode: 0644]
util/regression/sections/10/04.xcql [new file with mode: 0644]
util/regression/sections/10/05.xcql [new file with mode: 0644]
util/regression/sections/10/06.xcql [new file with mode: 0644]
util/regression/sections/10/07.xcql [new file with mode: 0644]
util/regression/sections/10/08.xcql [new file with mode: 0644]
util/regression/sections/10/09.xcql [new file with mode: 0644]
util/regression/sections/10/10.xcql [new file with mode: 0644]
util/regression/sections/10/11.xcql [new file with mode: 0644]
util/regression/sections/10/12.xcql [new file with mode: 0644]
util/regression/sections/10/13.xcql [new file with mode: 0644]
util/regression/sections/10/14.xcql [new file with mode: 0644]
util/regression/sections/10/15.xcql [new file with mode: 0644]
util/regression/sections/10/16.xcql [new file with mode: 0644]
util/regression/showtest [new file with mode: 0755]
util/regression/xmlpp.pl [new file with mode: 0755]

diff --git a/Changes b/Changes
index db9734b..d3e03e1 100644 (file)
--- a/Changes
+++ b/Changes
@@ -5,6 +5,10 @@ See the bottom of this file for a list of things still to do.
 The work for releases 1.0, 1.2 and 1.2.1 was sponsored by the National
 Library of Australia, whose help we gratefully acknowledge.
 
+1.12 TO BE RELEASED
+  - rewrite the CQL lexer to better conform to CQL spec (e.g retain escapes for     wildcards, etc)
+  - add jUnit test cases
+
 1.11 Tue  5 Mar 2013 13:38:18 CET
   - Fix problem with parsing unquoted terms that begin with a '.'
   - Fix problem with parsing unquoted terms that contain a '@'
diff --git a/README b/README
index 0120033..e01743d 100644 (file)
--- a/README
+++ b/README
@@ -40,16 +40,15 @@ WHAT'S WHAT IN THIS DISTRIBUTION?
        VERSION         The version-number of this distribution
        Changes         History of releases
        LGPL-2.1        The GNU lesser GPL (see below)
-       Makefile, Build Files to control compilation.
-       src             Source-code for the CQL-Java library
-       lib             The compiled library file, "cql-java.jar"
-       bin             Simple shell-scripts to invoke the test-harnesses
-       docs            Documentation automatically generated by "javadoc"
-       test            Various testing and sanity-checking frameworks
+       pom.xml Maven project file to control compilation.
+       src     Source-code for the CQL-Java library and tests
+       target  The compiled library file, "cql-java.jar" and javadoc
+       bin     Simple shell-scripts to invoke CQL programs (parser/lexer/generator)
+       util    Various testing and sanity-checking Perl scripts
        etc             Other files: PQF indexes, generator properties, etc.
 
 "Installation" of this package would consist of putting the bin
-directory on your PATH and lib/cql-java.jar on your CLASSPATH.
+directory on your PATH and target/cql-java.jar on your CLASSPATH.
 
 
 SYNOPSIS
@@ -88,16 +87,19 @@ Using the library in your own applications:
 DESCRIPTION
 -----------
 
-See the automatically generated class documentation in the "doc"
+See the automatically generated class documentation in the "target"
 subdirectory.
 
 
 AUTHOR
 ------
 
-Code and documentation by Mike Taylor, Index Data <mike@indexdata.com>
-       http://indexdata.com
+Original code and documentation by Mike Taylor, Index Data <mike@indexdata.com>
+At present maintained by Jakub Skoczen, Index Data <jakub@indexdata.dk>
+
+    http://www.indexdata.com/cql-java
        http://zing.z3950.org/cql
+
 Please email me with bug-reports, wishlist items, patches, deployment
 stories and, of course, large cash donations.
 
@@ -125,5 +127,6 @@ SEE ALSO
 
 Adam Dickmeiss's CQL compiler, written in C.
 Rob Sanderson's CQL compiler, written in Python.
+Jakub Skoczen's CQL-js compiler, written in JavaScript http://git.indexdata.com/?p=cql-js.git
 All the other free CQL compilers everyone's going to write  :-)
 The "Changes" file, including the "Still to do" section.
diff --git a/VERSION b/VERSION
index 6259340..809bdcb 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.8
+1.12
index 2c867ea..83bbe5b 100644 (file)
@@ -136,7 +136,7 @@ public class CQLLexer implements CQLTokenizer {
       case TT_EOF:
         return "EOF";
       case TT_WORD:
-        return "word: " + val;
+        return "word: '" + val + "'";
       case '"':
         return "string: \"" + val + "\"";
       case TT_LE:
diff --git a/test/random/Makefile b/test/random/Makefile
deleted file mode 100644 (file)
index d3e1421..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-
-all: ../../target/cql-java-1.8.jar
-       PATH=$(PATH):../../bin CLASSPATH=../../target/cql-java-1.8.jar ./mkrandom 100
-
-../../target/cql-java-1.8.jar:
-       cd ../../ && mvn package
-
-clean:
-       @echo "Nothing to do to 'make clean'"
-
diff --git a/test/random/README b/test/random/README
deleted file mode 100644 (file)
index 586796b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-
-In this directory, we test the integrity of the CQL-Java tools as
-follows:
-
-* Generate a random tree with CQLGenerate
-* Take a copy
-* Canonicalise it with CQLparser -c.
-* Compare the before-and-after versions.
-
-Since the CQLGenerate output is in canonical form anyway, the
-before-and-after versions should be identical.  This process exercises
-the comprehensiveness and bullet-proofing of the parser, as well as
-the accuracy of the rendering.
-
diff --git a/test/random/mkrandom b/test/random/mkrandom
deleted file mode 100755 (executable)
index 131e9e7..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/perl -w
-
-
-use strict;
-
-my $n = 1;
-if (@ARGV > 1) {
-    print STDERR "Usage: $0 [<number-of-trees>]\n";
-    exit 1;
-} elsif (@ARGV == 1) {
-    $n = $ARGV[0];
-}
-
-my $nok = 0;
-for (my $i = 0; $i < $n; $i++) {
-    print $i+1, " of $n -- ";
-    my $query=`CQLGenerator ../../etc/generate.properties`;
-    print $query;
-    my $canon=`CQLParser -c '$query'`;
-    if ($canon eq $query) {
-       $nok++;
-    } else {
-       print "ERROR: canonicalised query differs from original\n";
-    }
-}
-
-print "Passed $nok/$n -- ", int(100*$nok/$n), "%\n";
diff --git a/test/regression/Makefile b/test/regression/Makefile
deleted file mode 100644 (file)
index 5243e41..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-
-XMLCANONICALISER = cat
-# Change this to "./xmlpp.pl" if you want to check for equivalence
-
-test: sections/01/01.cql sections/01/01.xcql
-       ./runtests ../../bin/CQLParser $(XMLCANONICALISER)
-
-test-adam: sections/01/01.cql sections/01/01.xcql
-       ./runtests ../../../srw/cql/cql2xcql $(XMLCANONICALISER)
-
-test-rob: sections/01/01.cql sections/01/01.xcql
-       ./runtests ../../../rob/CQLParser.py $(XMLCANONICALISER)
-
-sections/01/01.cql: mktests queries.raw
-       ./mktests queries.raw
-
-sections/01/01.xcql: mkanswers
-       ./mkanswers ../../bin/CQLParser
-# OR   ./mkanswers ../../../srw/cql/cql2xcql
-# OR   ./mkanswers ../../../rob/CQLParser.py
-# Depending on which parser you want to use as your reference
-
-clean:
-       @echo "Nothing to do to 'make clean'"
-
-distclean:
-       find sections . -name '*.cql' -exec rm \{\} \;
-
-refclean:
-       find sections . -name '*.xcql' -exec rm \{\} \;
diff --git a/test/regression/README b/test/regression/README
deleted file mode 100644 (file)
index 0d7b96b..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-
-If you just don't want to think about it
-----------------------------------------
-
-Just use "make" to run regression tests.
-
-
-CQL-Java's regression-testing framework
----------------------------------------
-
-"queries.raw" is the file of test queries as provided by Rob.
-"mktests" parses the raw file into sections and individual queries
-"sections" is the top-level directory created by that program.
-  "01", "02" etc. represent the sections within the raw file
-    "01/name", "02/name", etc. contain the names of the sections.
-    "01/01.cql", "01/02.cql" etc. are the CQL queries themselves.
-"mkanswers" uses a trusted CQL compiler to generate corresponding XCQL.
-    "01/01.xcql", "01/02.xcql" etc. are the compiled XCQL queries.
-
-Apart from the CQL files, all of the files described to this point are
-included in the distribution, with the "trusted" XCQL output produced
-by my own compiler, and used for regression testing of new versions.
-The CQL files are re-created from "queries.raw" as required.  But
-you're welcome to "make refclean" and rebuild it with mkanswers, to
-contain the trusted compiler output of your choice.
-
-"runtests" compares the output of a nominated CQL compiler with
-existing XCQL files.  Most often, you'll use this to compare the
-results of your own build of CQL-Java with those of my build.  I'll
-use it to test new versions, and people who've written other compilers
-can use it to test their code.  (The code of "runtests" and
-"mkanswers" is worryingly similar: they should probably be the same
-program invoked with different command-line arguments.)
-
-"Makefile" controls the building of all this.  You'll need to edit it
-if you want to use different compilers and suchlike from what's
-written into it, so it may be easier to run the tests by hand -- but
-it's a useful reference for the kinds of commands you might need,
-anyway.  In general, "make" will run the regression tests, creating
-whatever CQL and/or XCQL files it needs; if you do "make refclean"
-first, then the next "make" will rebuild the reference results.
-
-So, for example, if you think Rob Sanderson's parser, CQLParser.py, is
-reliable, and you want to test my parser, CQL-Java's CQLParser class,
-against its results, do this:
-
-       make refclean
-       ./mktests queries.raw
-       ./mkanswers CQLParser.py
-       ./runtests ../../bin/CQLParser ./xmlpp.pl
-
-The second argument to ./runtests is the name of a program to use to
-normalise XML, so that the trusted output and the output being tested
-can be compared for equivalence rather than just for being
-byte-identical.  (If you want to test for byte-identical XCQL, then
-use "cat" as the second argument.)  xmlpp.pl is a fine XML
-pretty-printer from DecisionSoft, found at
-       http://software.decisionsoft.com/tools.html
-
-"showtest" can be used to run a single test showing more details of
-what goes wrong, if anything.  You don't need it as part of the
-regression test, but it's useful when debugging.
-
-Finally, "runcanon" checks that each of the queries when compiled and
-decompiled back to CQL (i.e. canonicalised) remains identical when
-recompiled and redecompiled.
-
-
-Appendix: queries that should fail
-----------------------------------
-
-The following queries are included in Rob's master list, in a final
-section called "Invalid searches [should error]".  They are all
-expected to fail in various ways.  I've taken them out of
-"queries.raw" because it's uninteresting, not to mention rather
-disturbing, to watch compilers fail.  More important, I think, to
-demonstrate correct behaviour for the known-to-work queries.
-
->
-===
-cat or
-index any 
-index any/wrong term
-a prox/wrong b
-()
-(a
-index any fish)
-(cat any dog or ())
-title = ("illegal parentheses")
-"quoted" any "illegal quotes"
-> illegal="urn:missingQuery"
-"fish" and > illegal="urn:invalidPrefixLocation" "chips"
diff --git a/test/regression/mkanswers b/test/regression/mkanswers
deleted file mode 100755 (executable)
index 16e7dd2..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/perl -w
-
-
-use IO::File;
-use strict;
-
-$ENV{CLASSPATH} .= ":../../lib/cql-java.jar";
-
-if (@ARGV != 1) {
-    print STDERR "Usage: $0 <trusted-CQL-compiler>\n";
-    exit(1);
-}
-my $compiler = $ARGV[0];
-
-while (<sections/*>) {
-    my $sdir = $_;
-    s@sections/@@;
-    next if /^CVS$/ || /^10$/; # I _can't_ get CVS to stop extracting "10"
-    print "answering section $_ - ", read_file("$sdir/name"), "\n";
-
-    while (<$sdir/*.cql>) {
-       my $qfile = $_;
-       s@sections/([0-9]+/.*)\.cql@$1@;
-       my $query = read_file($qfile);
-       my $afile = $qfile;
-       $afile =~ s/\.cql$/.xcql/;
-       print "  wrote $_ - $query\n";
-       my $fh = new IO::File("| $compiler > $afile")
-           or die "can't run compiler '$compiler': $!";
-       print $fh $query;
-       $fh->close();
-    }
-}
-
-sub read_file {
-    my($name) = @_;
-
-    my $fh = new IO::File("<$name")
-       or die "can't read '$name': $!";
-    my $contents = join('', <$fh>);
-    $fh->close();
-    return $contents;
-}
diff --git a/test/regression/mktests b/test/regression/mktests
deleted file mode 100755 (executable)
index 78057b0..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/perl -w
-
-
-use IO::File;
-use strict;
-
-maybe_mkdir("sections");
-my $section = 0;
-my $dir;
-my $query;
-
-while (<>) {
-    chomp();
-    s/[ \t]+$//;
-    next if /^$/;
-
-    if (s/^#[ \t]*//) {
-       $section++;
-       $query = 0;
-       $dir = "sections/" . substr("0$section", -2);
-       maybe_mkdir($dir);
-       write_file("$dir/name", $_);
-       print "created section $section ($dir) - $_\n";
-       next;
-    }
-
-    die "query before first section header"
-       if !defined $dir;
-
-    $query++;
-    my $filename = $dir . "/" . substr("0$query", -2) . ".cql";
-    write_file($filename, $_);
-    $filename =~ s@sections/(.*)\.cql@$1@;
-    print "  added $filename - $_\n";
-}
-
-sub write_file {
-    my($name, $contents) = @_;
-
-    my $fh = new IO::File(">$name")
-       or die "can't create '$name': $!";
-    $fh->print($contents);
-    $fh->close();
-}
-
-sub maybe_mkdir {
-    my($dir) = shift();
-    if (mkdir $dir) {
-       return;
-    }
-    if ($! =~ /exists/i) {
-       return;
-    }
-    die "can't create directory '$dir': $!";
-}
diff --git a/test/regression/queries.raw b/test/regression/queries.raw
deleted file mode 100644 (file)
index 6075e69..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-
-# Simple 
-
-cat
-"cat"
-comp.os.linux
-xml:element
-"<xml:element>"
-"="
-"prox/distance<3/unit=word"
-("cat")
-((dog))
-all
-prox
-
-# Index Relation Term
-
-title = "fish"
-title exact fish
-title any fish
-title all fish
-title > 9
-title >= 23
-dc.title any "fish chips"
-dc.title any/stem fish
-dc.fish all/stem/fuzzy "fish chips"
-(title any frog)
-((dc.title any/stem "frog pond"))
-dc.title any "fish frog chicken"
-dc.title =/rel.algorithm=CORI squid
-author any/f.foo/b.bar>1 "sanderson taylor"
-numberOfLegs <= 4
-numberOfLegs <> 4
-title == jaws
-
-# Simple Boolean
-
-cat or dog
-cat and fish
-cat not frog
-(cat not frog)
-"cat" not "fish food"
-xml and "prox///"
-fred and any
-((fred or all))
-a or b and c not d
-
-# I/R/T plus Boolean
-
-bath.author any fish and dc.title all "cat dog"
-(title any/stem "fish dog" or and)
-
-# Prox
-
-cat prox hat
-cat prox/distance=3/unit=word/ordered hat
-cat prox/distance<3 hat
-"fish food" prox/unit=sentence and
-title all "chips frog" prox/distance<=5 exact
-(dc.author == "jones" prox/distance>5/unit=element title >= "smith")
-((cat prox hat))
-a and/rel.SumOfScores b
-a and/rel.algorithm=CORI b
-
-# Special Characters
-
-(cat^)
-"cat"
-"^cat says \"fish\""
-"cat*fish"
-cat?dog
-(("^cat*fishdog\"horse?"))
-
-# Nesting Parentheses
-
-(((cat or dog) or horse) and frog)
-(cat and dog) or (horse and frog)
-(cat and (horse or frog)) and chips
-
-# Prefix Maps
-
-> foo="http://www.loc.gov/zing/cql/dc-indexes/" dc.title="fish"
-> "http://www.loc.gov/zing/cql/dc-indexes/" title="fish"
-> foo="http://www.loc.gov/zing/cql/dc-indexes" > ccg = "http://srw.o-r-g.org/cql/indexSets/ccg/" foo.title="fish" and ccg.force=3
-
-# Lame Searches
-
-any or all:stem and all contains any prox proxfuzzy
-(((((((((any)))))))))
-""
-> any > any = exact any > any
-sortby sortby sortby
-sortby sortby sortby sortby sortby
-
-# Sorting
-
-kernighan sortby title
-kernighan and ritchie sortby title
-dc.creator=kernighan sortby dc.title
-dc.creator=kernighan sortby numberOfLegs/cql.number
-dc.creator=kernighan sortby dc.title/sort.respectCase
-dc.creator=kernighan sortby dc.title/sort.respectCase/sort.descending
-dc.creator=kernighan sortby dc.date dc.title
-dc.creator=kernighan sortby dc.date/sort.missingOmit
-dc.creator=kernighan sortby dc.date/sort.missingValue=1970
->dc="http://deepcustard.org/1.0" blah sortby dc.custardDepth
->ns1="http://uri1" >ns2="http://uri2" whatever sortby ns1.key/a/b/c=1 ns2.key2
-(>dc=x b=c) sortby d
-b=(>dc=x c) sortby d
-(>dc=x c1 and c2) sortby d
->dc="http://deepcustard.org" (>dc="http://dublincore.org" dc.title=jaws) sortby dc.custardDepth
->dc="http://deepcustard.org" (fish or >dc="http://dublincore.org" dc.title=jaws) sortby dc.custardDepth
diff --git a/test/regression/runcanon b/test/regression/runcanon
deleted file mode 100755 (executable)
index 46d6a93..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/perl -w
-
-#
-# Tests that all sample queries can be rendered into idempotent
-# canoncial form.
-
-use IO::File;
-use strict;
-
-$ENV{CLASSPATH} .= ":../../lib/cql-java.jar";
-
-my($ntests, $ncorrect) = (0, 0);
-
-while (<sections/*>) {
-    my $sdir = $_;
-    s@sections/@@;
-    next if /^CVS$/ || /^10$/;
-    print "testing section $_ - ", read_file("$sdir/name"), "\n";
-
-    while (<$sdir/*.cql>) {
-       my $qfile = $_;
-       s@sections/([0-9]+/.*)\.cql@$1@;
-       my $query = read_file($qfile);
-       my $canonical = `CQLParser -c '$query'`;
-       chomp($canonical);
-       my $maybe = `CQLParser -c '$canonical'`;
-       chomp($maybe);
-       print "$query // $canonical ";
-       $ntests++;
-       if ($maybe eq $canonical) {
-           $ncorrect++;
-           print " OK\n";
-       } else {
-           print "### $maybe\n";
-       }
-    }
-}
-
-print sprintf("%d of %d passed: %d%%\n",
-             $ncorrect, $ntests, (100 * $ncorrect) / $ntests);
-
-sub read_file {
-    my($name) = @_;
-
-    $name = "<$name" if $name !~ /\|$/;
-    my $fh = new IO::File("$name")
-       or die "can't read '$name': $!";
-    my $contents = join('', <$fh>);
-    $fh->close();
-    return $contents;
-}
diff --git a/test/regression/runtests b/test/regression/runtests
deleted file mode 100755 (executable)
index c12cd3c..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/perl -w
-
-
-use IO::File;
-use strict;
-
-$ENV{CLASSPATH} .= ":../../src/main/java";
-$ENV{CLASSPATH} .= ":../../lib/cql-java.jar";
-
-if (@ARGV != 2) {
-    print STDERR "Usage: $0 <CQL-compiler> <XML-normaliser>\n";
-    exit(1);
-}
-my $compiler = $ARGV[0];
-my $norman = $ARGV[1];         # name of XML normaliser program
-my($ntests, $ncorrect) = (0, 0);
-
-while (<sections/*>) {
-    my $sdir = $_;
-    s@sections/@@;
-    next if /^CVS$/;
-    print "testing section $_ - ", read_file("$sdir/name"), "\n";
-
-    while (<$sdir/*.cql>) {
-       my $qfile = $_;
-       s@sections/([0-9]+/.*)\.cql@$1@;
-       my $query = read_file($qfile);
-       my $afile = $qfile;
-       $afile =~ s/\.cql$/.xcql/;
-       print "  query $_ - $query  ";
-       $ntests++;
-       my $correct = read_file("$norman < $afile |");
-       my $tested = read_file("$compiler < $qfile | $norman |");
-       if (!$tested) {
-           print "\n    *** test compiler exited non-zero\n";
-       } elsif ($tested eq $correct) {
-           print "OK\n";
-           $ncorrect++;
-       } else {
-           print "\n    *** XCQL output differs from $afile\n";
-           print "=== tested ===\n$tested";
-           print "=== end ===\n";
-       }
-    }
-}
-
-print sprintf("%d of %d passed: %d%%\n",
-             $ncorrect, $ntests, (100 * $ncorrect) / $ntests);
-
-sub read_file {
-    my($name) = @_;
-
-    $name = "<$name" if $name !~ /\|$/;
-    my $fh = new IO::File("$name")
-       or die "can't read '$name': $!";
-    my $contents = join('', <$fh>);
-    $fh->close();
-    return $contents;
-}
diff --git a/test/regression/sections/01/.gitignore b/test/regression/sections/01/.gitignore
deleted file mode 100644 (file)
index b03b3d1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-name
-*.cql
diff --git a/test/regression/sections/01/01.xcql b/test/regression/sections/01/01.xcql
deleted file mode 100644 (file)
index 48aee99..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>cat</term>
-</searchClause>
diff --git a/test/regression/sections/01/02.xcql b/test/regression/sections/01/02.xcql
deleted file mode 100644 (file)
index 48aee99..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>cat</term>
-</searchClause>
diff --git a/test/regression/sections/01/03.xcql b/test/regression/sections/01/03.xcql
deleted file mode 100644 (file)
index af191d3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>comp.os.linux</term>
-</searchClause>
diff --git a/test/regression/sections/01/04.xcql b/test/regression/sections/01/04.xcql
deleted file mode 100644 (file)
index 4141430..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>xml:element</term>
-</searchClause>
diff --git a/test/regression/sections/01/05.xcql b/test/regression/sections/01/05.xcql
deleted file mode 100644 (file)
index 6ec410e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>&lt;xml:element&gt;</term>
-</searchClause>
diff --git a/test/regression/sections/01/06.xcql b/test/regression/sections/01/06.xcql
deleted file mode 100644 (file)
index da69755..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>=</term>
-</searchClause>
diff --git a/test/regression/sections/01/07.xcql b/test/regression/sections/01/07.xcql
deleted file mode 100644 (file)
index 851a5c1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>prox/distance&lt;3/unit=word</term>
-</searchClause>
diff --git a/test/regression/sections/01/08.xcql b/test/regression/sections/01/08.xcql
deleted file mode 100644 (file)
index 48aee99..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>cat</term>
-</searchClause>
diff --git a/test/regression/sections/01/09.xcql b/test/regression/sections/01/09.xcql
deleted file mode 100644 (file)
index d41b39e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>dog</term>
-</searchClause>
diff --git a/test/regression/sections/01/10.xcql b/test/regression/sections/01/10.xcql
deleted file mode 100644 (file)
index c5ac7f6..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>all</term>
-</searchClause>
diff --git a/test/regression/sections/01/11.xcql b/test/regression/sections/01/11.xcql
deleted file mode 100644 (file)
index 88da9eb..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>prox</term>
-</searchClause>
diff --git a/test/regression/sections/02/.gitignore b/test/regression/sections/02/.gitignore
deleted file mode 100644 (file)
index b03b3d1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-name
-*.cql
diff --git a/test/regression/sections/02/01.xcql b/test/regression/sections/02/01.xcql
deleted file mode 100644 (file)
index be3c9c1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>title</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>fish</term>
-</searchClause>
diff --git a/test/regression/sections/02/02.xcql b/test/regression/sections/02/02.xcql
deleted file mode 100644 (file)
index 2b78ddf..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>title</index>
-  <relation>
-    <value>exact</value>
-  </relation>
-  <term>fish</term>
-</searchClause>
diff --git a/test/regression/sections/02/03.xcql b/test/regression/sections/02/03.xcql
deleted file mode 100644 (file)
index 62521be..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>title</index>
-  <relation>
-    <value>any</value>
-  </relation>
-  <term>fish</term>
-</searchClause>
diff --git a/test/regression/sections/02/04.xcql b/test/regression/sections/02/04.xcql
deleted file mode 100644 (file)
index 646c973..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>title</index>
-  <relation>
-    <value>all</value>
-  </relation>
-  <term>fish</term>
-</searchClause>
diff --git a/test/regression/sections/02/05.xcql b/test/regression/sections/02/05.xcql
deleted file mode 100644 (file)
index 92411c4..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>title</index>
-  <relation>
-    <value>&gt;</value>
-  </relation>
-  <term>9</term>
-</searchClause>
diff --git a/test/regression/sections/02/06.xcql b/test/regression/sections/02/06.xcql
deleted file mode 100644 (file)
index 6702471..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>title</index>
-  <relation>
-    <value>&gt;=</value>
-  </relation>
-  <term>23</term>
-</searchClause>
diff --git a/test/regression/sections/02/07.xcql b/test/regression/sections/02/07.xcql
deleted file mode 100644 (file)
index ba4ac78..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>dc.title</index>
-  <relation>
-    <value>any</value>
-  </relation>
-  <term>fish chips</term>
-</searchClause>
diff --git a/test/regression/sections/02/08.xcql b/test/regression/sections/02/08.xcql
deleted file mode 100644 (file)
index 1576778..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<searchClause>
-  <index>dc.title</index>
-  <relation>
-    <value>any</value>
-    <modifiers>
-      <modifier>
-        <type>stem</type>
-      </modifier>
-    </modifiers>
-  </relation>
-  <term>fish</term>
-</searchClause>
diff --git a/test/regression/sections/02/09.xcql b/test/regression/sections/02/09.xcql
deleted file mode 100644 (file)
index 9f8abff..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<searchClause>
-  <index>dc.fish</index>
-  <relation>
-    <value>all</value>
-    <modifiers>
-      <modifier>
-        <type>stem</type>
-      </modifier>
-      <modifier>
-        <type>fuzzy</type>
-      </modifier>
-    </modifiers>
-  </relation>
-  <term>fish chips</term>
-</searchClause>
diff --git a/test/regression/sections/02/10.xcql b/test/regression/sections/02/10.xcql
deleted file mode 100644 (file)
index d7dfe7a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>title</index>
-  <relation>
-    <value>any</value>
-  </relation>
-  <term>frog</term>
-</searchClause>
diff --git a/test/regression/sections/02/11.xcql b/test/regression/sections/02/11.xcql
deleted file mode 100644 (file)
index 726a36e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<searchClause>
-  <index>dc.title</index>
-  <relation>
-    <value>any</value>
-    <modifiers>
-      <modifier>
-        <type>stem</type>
-      </modifier>
-    </modifiers>
-  </relation>
-  <term>frog pond</term>
-</searchClause>
diff --git a/test/regression/sections/02/12.xcql b/test/regression/sections/02/12.xcql
deleted file mode 100644 (file)
index b4bcf3b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>dc.title</index>
-  <relation>
-    <value>any</value>
-  </relation>
-  <term>fish frog chicken</term>
-</searchClause>
diff --git a/test/regression/sections/02/13.xcql b/test/regression/sections/02/13.xcql
deleted file mode 100644 (file)
index 6f3c011..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<searchClause>
-  <index>dc.title</index>
-  <relation>
-    <value>=</value>
-    <modifiers>
-      <modifier>
-        <type>rel.algorithm</type>
-        <comparison>=</comparison>
-        <value>CORI</value>
-      </modifier>
-    </modifiers>
-  </relation>
-  <term>squid</term>
-</searchClause>
diff --git a/test/regression/sections/02/14.xcql b/test/regression/sections/02/14.xcql
deleted file mode 100644 (file)
index c833d26..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<searchClause>
-  <index>author</index>
-  <relation>
-    <value>any</value>
-    <modifiers>
-      <modifier>
-        <type>f.foo</type>
-      </modifier>
-      <modifier>
-        <type>b.bar</type>
-        <comparison>&gt;</comparison>
-        <value>1</value>
-      </modifier>
-    </modifiers>
-  </relation>
-  <term>sanderson taylor</term>
-</searchClause>
diff --git a/test/regression/sections/02/15.xcql b/test/regression/sections/02/15.xcql
deleted file mode 100644 (file)
index 3a23abe..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>numberOfLegs</index>
-  <relation>
-    <value>&lt;=</value>
-  </relation>
-  <term>4</term>
-</searchClause>
diff --git a/test/regression/sections/02/16.xcql b/test/regression/sections/02/16.xcql
deleted file mode 100644 (file)
index 0e8eccd..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>numberOfLegs</index>
-  <relation>
-    <value>&lt;&gt;</value>
-  </relation>
-  <term>4</term>
-</searchClause>
diff --git a/test/regression/sections/02/17.xcql b/test/regression/sections/02/17.xcql
deleted file mode 100644 (file)
index b2587ff..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>title</index>
-  <relation>
-    <value>==</value>
-  </relation>
-  <term>jaws</term>
-</searchClause>
diff --git a/test/regression/sections/03/.gitignore b/test/regression/sections/03/.gitignore
deleted file mode 100644 (file)
index b03b3d1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-name
-*.cql
diff --git a/test/regression/sections/03/01.xcql b/test/regression/sections/03/01.xcql
deleted file mode 100644 (file)
index fc1b678..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<triple>
-  <boolean>
-    <value>or</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>cat</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>dog</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/03/02.xcql b/test/regression/sections/03/02.xcql
deleted file mode 100644 (file)
index 55ae66a..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<triple>
-  <boolean>
-    <value>and</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>cat</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>fish</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/03/03.xcql b/test/regression/sections/03/03.xcql
deleted file mode 100644 (file)
index 2f4f6c0..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<triple>
-  <boolean>
-    <value>not</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>cat</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>frog</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/03/04.xcql b/test/regression/sections/03/04.xcql
deleted file mode 100644 (file)
index 2f4f6c0..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<triple>
-  <boolean>
-    <value>not</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>cat</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>frog</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/03/05.xcql b/test/regression/sections/03/05.xcql
deleted file mode 100644 (file)
index 9ad0700..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<triple>
-  <boolean>
-    <value>not</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>cat</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>fish food</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/03/06.xcql b/test/regression/sections/03/06.xcql
deleted file mode 100644 (file)
index 7b8dae8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<triple>
-  <boolean>
-    <value>and</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>xml</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>prox///</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/03/07.xcql b/test/regression/sections/03/07.xcql
deleted file mode 100644 (file)
index 5e0076e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<triple>
-  <boolean>
-    <value>and</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>fred</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>any</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/03/08.xcql b/test/regression/sections/03/08.xcql
deleted file mode 100644 (file)
index f080d4b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<triple>
-  <boolean>
-    <value>or</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>fred</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>all</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/03/09.xcql b/test/regression/sections/03/09.xcql
deleted file mode 100644 (file)
index 4f3ade7..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<triple>
-  <boolean>
-    <value>not</value>
-  </boolean>
-  <leftOperand>
-    <triple>
-      <boolean>
-        <value>and</value>
-      </boolean>
-      <leftOperand>
-        <triple>
-          <boolean>
-            <value>or</value>
-          </boolean>
-          <leftOperand>
-            <searchClause>
-              <index>cql.serverChoice</index>
-              <relation>
-                <value>=</value>
-              </relation>
-              <term>a</term>
-            </searchClause>
-          </leftOperand>
-          <rightOperand>
-            <searchClause>
-              <index>cql.serverChoice</index>
-              <relation>
-                <value>=</value>
-              </relation>
-              <term>b</term>
-            </searchClause>
-          </rightOperand>
-        </triple>
-      </leftOperand>
-      <rightOperand>
-        <searchClause>
-          <index>cql.serverChoice</index>
-          <relation>
-            <value>=</value>
-          </relation>
-          <term>c</term>
-        </searchClause>
-      </rightOperand>
-    </triple>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>d</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/04/.gitignore b/test/regression/sections/04/.gitignore
deleted file mode 100644 (file)
index b03b3d1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-name
-*.cql
diff --git a/test/regression/sections/04/01.xcql b/test/regression/sections/04/01.xcql
deleted file mode 100644 (file)
index 6f3ec27..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<triple>
-  <boolean>
-    <value>and</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>bath.author</index>
-      <relation>
-        <value>any</value>
-      </relation>
-      <term>fish</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>dc.title</index>
-      <relation>
-        <value>all</value>
-      </relation>
-      <term>cat dog</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/04/02.xcql b/test/regression/sections/04/02.xcql
deleted file mode 100644 (file)
index 0dcb869..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<triple>
-  <boolean>
-    <value>or</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>title</index>
-      <relation>
-        <value>any</value>
-        <modifiers>
-          <modifier>
-            <type>stem</type>
-          </modifier>
-        </modifiers>
-      </relation>
-      <term>fish dog</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>and</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/05/.gitignore b/test/regression/sections/05/.gitignore
deleted file mode 100644 (file)
index b03b3d1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-name
-*.cql
diff --git a/test/regression/sections/05/01.xcql b/test/regression/sections/05/01.xcql
deleted file mode 100644 (file)
index 406d103..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<triple>
-  <boolean>
-    <value>prox</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>cat</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>hat</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/05/02.xcql b/test/regression/sections/05/02.xcql
deleted file mode 100644 (file)
index f09ab0b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<triple>
-  <boolean>
-    <value>prox</value>
-    <modifiers>
-      <modifier>
-        <type>distance</type>
-        <comparison>=</comparison>
-        <value>3</value>
-      </modifier>
-      <modifier>
-        <type>unit</type>
-        <comparison>=</comparison>
-        <value>word</value>
-      </modifier>
-      <modifier>
-        <type>ordered</type>
-      </modifier>
-    </modifiers>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>cat</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>hat</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/05/03.xcql b/test/regression/sections/05/03.xcql
deleted file mode 100644 (file)
index 25c5377..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<triple>
-  <boolean>
-    <value>prox</value>
-    <modifiers>
-      <modifier>
-        <type>distance</type>
-        <comparison>&lt;</comparison>
-        <value>3</value>
-      </modifier>
-    </modifiers>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>cat</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>hat</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/05/04.xcql b/test/regression/sections/05/04.xcql
deleted file mode 100644 (file)
index a6e2198..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<triple>
-  <boolean>
-    <value>prox</value>
-    <modifiers>
-      <modifier>
-        <type>unit</type>
-        <comparison>=</comparison>
-        <value>sentence</value>
-      </modifier>
-    </modifiers>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>fish food</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>and</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/05/05.xcql b/test/regression/sections/05/05.xcql
deleted file mode 100644 (file)
index a59341f..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<triple>
-  <boolean>
-    <value>prox</value>
-    <modifiers>
-      <modifier>
-        <type>distance</type>
-        <comparison>&lt;=</comparison>
-        <value>5</value>
-      </modifier>
-    </modifiers>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>title</index>
-      <relation>
-        <value>all</value>
-      </relation>
-      <term>chips frog</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>exact</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/05/06.xcql b/test/regression/sections/05/06.xcql
deleted file mode 100644 (file)
index 4ffea29..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<triple>
-  <boolean>
-    <value>prox</value>
-    <modifiers>
-      <modifier>
-        <type>distance</type>
-        <comparison>&gt;</comparison>
-        <value>5</value>
-      </modifier>
-      <modifier>
-        <type>unit</type>
-        <comparison>=</comparison>
-        <value>element</value>
-      </modifier>
-    </modifiers>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>dc.author</index>
-      <relation>
-        <value>==</value>
-      </relation>
-      <term>jones</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>title</index>
-      <relation>
-        <value>&gt;=</value>
-      </relation>
-      <term>smith</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/05/07.xcql b/test/regression/sections/05/07.xcql
deleted file mode 100644 (file)
index 406d103..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<triple>
-  <boolean>
-    <value>prox</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>cat</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>hat</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/05/08.xcql b/test/regression/sections/05/08.xcql
deleted file mode 100644 (file)
index b46dcfd..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<triple>
-  <boolean>
-    <value>and</value>
-    <modifiers>
-      <modifier>
-        <type>rel.sumofscores</type>
-      </modifier>
-    </modifiers>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>a</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>b</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/05/09.xcql b/test/regression/sections/05/09.xcql
deleted file mode 100644 (file)
index 1dc3602..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<triple>
-  <boolean>
-    <value>and</value>
-    <modifiers>
-      <modifier>
-        <type>rel.algorithm</type>
-        <comparison>=</comparison>
-        <value>CORI</value>
-      </modifier>
-    </modifiers>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>a</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>b</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/06/.gitignore b/test/regression/sections/06/.gitignore
deleted file mode 100644 (file)
index b03b3d1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-name
-*.cql
diff --git a/test/regression/sections/06/01.xcql b/test/regression/sections/06/01.xcql
deleted file mode 100644 (file)
index 0dcc5fb..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>cat^</term>
-</searchClause>
diff --git a/test/regression/sections/06/02.xcql b/test/regression/sections/06/02.xcql
deleted file mode 100644 (file)
index 48aee99..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>cat</term>
-</searchClause>
diff --git a/test/regression/sections/06/03.xcql b/test/regression/sections/06/03.xcql
deleted file mode 100644 (file)
index 9db40ae..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>^cat says "fish"</term>
-</searchClause>
diff --git a/test/regression/sections/06/04.xcql b/test/regression/sections/06/04.xcql
deleted file mode 100644 (file)
index ee38b0e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>cat*fish</term>
-</searchClause>
diff --git a/test/regression/sections/06/05.xcql b/test/regression/sections/06/05.xcql
deleted file mode 100644 (file)
index dc59539..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>cat?dog</term>
-</searchClause>
diff --git a/test/regression/sections/06/06.xcql b/test/regression/sections/06/06.xcql
deleted file mode 100644 (file)
index 9d38695..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>^cat*fishdog"horse?</term>
-</searchClause>
diff --git a/test/regression/sections/07/.gitignore b/test/regression/sections/07/.gitignore
deleted file mode 100644 (file)
index b03b3d1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-name
-*.cql
diff --git a/test/regression/sections/07/01.xcql b/test/regression/sections/07/01.xcql
deleted file mode 100644 (file)
index 3338a9f..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<triple>
-  <boolean>
-    <value>and</value>
-  </boolean>
-  <leftOperand>
-    <triple>
-      <boolean>
-        <value>or</value>
-      </boolean>
-      <leftOperand>
-        <triple>
-          <boolean>
-            <value>or</value>
-          </boolean>
-          <leftOperand>
-            <searchClause>
-              <index>cql.serverChoice</index>
-              <relation>
-                <value>=</value>
-              </relation>
-              <term>cat</term>
-            </searchClause>
-          </leftOperand>
-          <rightOperand>
-            <searchClause>
-              <index>cql.serverChoice</index>
-              <relation>
-                <value>=</value>
-              </relation>
-              <term>dog</term>
-            </searchClause>
-          </rightOperand>
-        </triple>
-      </leftOperand>
-      <rightOperand>
-        <searchClause>
-          <index>cql.serverChoice</index>
-          <relation>
-            <value>=</value>
-          </relation>
-          <term>horse</term>
-        </searchClause>
-      </rightOperand>
-    </triple>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>frog</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/07/02.xcql b/test/regression/sections/07/02.xcql
deleted file mode 100644 (file)
index 1324889..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<triple>
-  <boolean>
-    <value>or</value>
-  </boolean>
-  <leftOperand>
-    <triple>
-      <boolean>
-        <value>and</value>
-      </boolean>
-      <leftOperand>
-        <searchClause>
-          <index>cql.serverChoice</index>
-          <relation>
-            <value>=</value>
-          </relation>
-          <term>cat</term>
-        </searchClause>
-      </leftOperand>
-      <rightOperand>
-        <searchClause>
-          <index>cql.serverChoice</index>
-          <relation>
-            <value>=</value>
-          </relation>
-          <term>dog</term>
-        </searchClause>
-      </rightOperand>
-    </triple>
-  </leftOperand>
-  <rightOperand>
-    <triple>
-      <boolean>
-        <value>and</value>
-      </boolean>
-      <leftOperand>
-        <searchClause>
-          <index>cql.serverChoice</index>
-          <relation>
-            <value>=</value>
-          </relation>
-          <term>horse</term>
-        </searchClause>
-      </leftOperand>
-      <rightOperand>
-        <searchClause>
-          <index>cql.serverChoice</index>
-          <relation>
-            <value>=</value>
-          </relation>
-          <term>frog</term>
-        </searchClause>
-      </rightOperand>
-    </triple>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/07/03.xcql b/test/regression/sections/07/03.xcql
deleted file mode 100644 (file)
index 202af98..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<triple>
-  <boolean>
-    <value>and</value>
-  </boolean>
-  <leftOperand>
-    <triple>
-      <boolean>
-        <value>and</value>
-      </boolean>
-      <leftOperand>
-        <searchClause>
-          <index>cql.serverChoice</index>
-          <relation>
-            <value>=</value>
-          </relation>
-          <term>cat</term>
-        </searchClause>
-      </leftOperand>
-      <rightOperand>
-        <triple>
-          <boolean>
-            <value>or</value>
-          </boolean>
-          <leftOperand>
-            <searchClause>
-              <index>cql.serverChoice</index>
-              <relation>
-                <value>=</value>
-              </relation>
-              <term>horse</term>
-            </searchClause>
-          </leftOperand>
-          <rightOperand>
-            <searchClause>
-              <index>cql.serverChoice</index>
-              <relation>
-                <value>=</value>
-              </relation>
-              <term>frog</term>
-            </searchClause>
-          </rightOperand>
-        </triple>
-      </rightOperand>
-    </triple>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>chips</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/08/.gitignore b/test/regression/sections/08/.gitignore
deleted file mode 100644 (file)
index b03b3d1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-name
-*.cql
diff --git a/test/regression/sections/08/01.xcql b/test/regression/sections/08/01.xcql
deleted file mode 100644 (file)
index 4e2d548..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<searchClause>
-  <prefixes>
-    <prefix>
-      <name>foo</name>
-      <identifier>http://www.loc.gov/zing/cql/dc-indexes/</identifier>
-    </prefix>
-  </prefixes>
-  <index>dc.title</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>fish</term>
-</searchClause>
diff --git a/test/regression/sections/08/02.xcql b/test/regression/sections/08/02.xcql
deleted file mode 100644 (file)
index 63ce6ad..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<searchClause>
-  <prefixes>
-    <prefix>
-      <identifier>http://www.loc.gov/zing/cql/dc-indexes/</identifier>
-    </prefix>
-  </prefixes>
-  <index>title</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>fish</term>
-</searchClause>
diff --git a/test/regression/sections/08/03.xcql b/test/regression/sections/08/03.xcql
deleted file mode 100644 (file)
index 025c7c9..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<triple>
-  <prefixes>
-    <prefix>
-      <name>foo</name>
-      <identifier>http://www.loc.gov/zing/cql/dc-indexes</identifier>
-    </prefix>
-    <prefix>
-      <name>ccg</name>
-      <identifier>http://srw.o-r-g.org/cql/indexSets/ccg/</identifier>
-    </prefix>
-  </prefixes>
-  <boolean>
-    <value>and</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>foo.title</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>fish</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>ccg.force</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>3</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/09/.gitignore b/test/regression/sections/09/.gitignore
deleted file mode 100644 (file)
index b03b3d1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-name
-*.cql
diff --git a/test/regression/sections/09/01.xcql b/test/regression/sections/09/01.xcql
deleted file mode 100644 (file)
index f721ed0..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<triple>
-  <boolean>
-    <value>and</value>
-  </boolean>
-  <leftOperand>
-    <triple>
-      <boolean>
-        <value>or</value>
-      </boolean>
-      <leftOperand>
-        <searchClause>
-          <index>cql.serverChoice</index>
-          <relation>
-            <value>=</value>
-          </relation>
-          <term>any</term>
-        </searchClause>
-      </leftOperand>
-      <rightOperand>
-        <searchClause>
-          <index>cql.serverChoice</index>
-          <relation>
-            <value>=</value>
-          </relation>
-          <term>all:stem</term>
-        </searchClause>
-      </rightOperand>
-    </triple>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>all contains</index>
-      <relation>
-        <value>any</value>
-      </relation>
-      <term>prox proxfuzzy</term>
-    </searchClause>
-  </rightOperand>
-</triple>
diff --git a/test/regression/sections/09/02.xcql b/test/regression/sections/09/02.xcql
deleted file mode 100644 (file)
index dd7c8f0..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>any</term>
-</searchClause>
diff --git a/test/regression/sections/09/03.xcql b/test/regression/sections/09/03.xcql
deleted file mode 100644 (file)
index 1eeff16..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term></term>
-</searchClause>
diff --git a/test/regression/sections/09/04.xcql b/test/regression/sections/09/04.xcql
deleted file mode 100644 (file)
index aed8eca..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<searchClause>
-  <prefixes>
-    <prefix>
-      <identifier>any</identifier>
-    </prefix>
-    <prefix>
-      <name>any</name>
-      <identifier>exact</identifier>
-    </prefix>
-  </prefixes>
-  <index>any</index>
-  <relation>
-    <value>&gt;</value>
-  </relation>
-  <term>any</term>
-</searchClause>
diff --git a/test/regression/sections/09/05.xcql b/test/regression/sections/09/05.xcql
deleted file mode 100644 (file)
index 578af0f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>sortby</term>
-  <sortKeys>
-    <key>
-      <index>sortby</index>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/09/06.xcql b/test/regression/sections/09/06.xcql
deleted file mode 100644 (file)
index 2e136b5..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>sortby</term>
-  <sortKeys>
-    <key>
-      <index>sortby</index>
-    </key>
-    <key>
-      <index>sortby</index>
-    </key>
-    <key>
-      <index>sortby</index>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/10/.gitignore b/test/regression/sections/10/.gitignore
deleted file mode 100644 (file)
index b03b3d1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-name
-*.cql
diff --git a/test/regression/sections/10/01.xcql b/test/regression/sections/10/01.xcql
deleted file mode 100644 (file)
index 0c8cc74..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<searchClause>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>kernighan</term>
-  <sortKeys>
-    <key>
-      <index>title</index>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/10/02.xcql b/test/regression/sections/10/02.xcql
deleted file mode 100644 (file)
index dbd6407..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<triple>
-  <boolean>
-    <value>and</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>kernighan</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>ritchie</term>
-    </searchClause>
-  </rightOperand>
-  <sortKeys>
-    <key>
-      <index>title</index>
-    </key>
-  </sortKeys>
-</triple>
diff --git a/test/regression/sections/10/03.xcql b/test/regression/sections/10/03.xcql
deleted file mode 100644 (file)
index eaef782..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<searchClause>
-  <index>dc.creator</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>kernighan</term>
-  <sortKeys>
-    <key>
-      <index>dc.title</index>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/10/04.xcql b/test/regression/sections/10/04.xcql
deleted file mode 100644 (file)
index 3a32884..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<searchClause>
-  <index>dc.creator</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>kernighan</term>
-  <sortKeys>
-    <key>
-      <index>numberOfLegs</index>
-      <modifiers>
-        <modifier>
-          <type>cql.number</type>
-        </modifier>
-      </modifiers>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/10/05.xcql b/test/regression/sections/10/05.xcql
deleted file mode 100644 (file)
index 5821b04..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<searchClause>
-  <index>dc.creator</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>kernighan</term>
-  <sortKeys>
-    <key>
-      <index>dc.title</index>
-      <modifiers>
-        <modifier>
-          <type>sort.respectcase</type>
-        </modifier>
-      </modifiers>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/10/06.xcql b/test/regression/sections/10/06.xcql
deleted file mode 100644 (file)
index 8d232b2..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<searchClause>
-  <index>dc.creator</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>kernighan</term>
-  <sortKeys>
-    <key>
-      <index>dc.title</index>
-      <modifiers>
-        <modifier>
-          <type>sort.respectcase</type>
-        </modifier>
-        <modifier>
-          <type>sort.descending</type>
-        </modifier>
-      </modifiers>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/10/07.xcql b/test/regression/sections/10/07.xcql
deleted file mode 100644 (file)
index 13737ee..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<searchClause>
-  <index>dc.creator</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>kernighan</term>
-  <sortKeys>
-    <key>
-      <index>dc.date</index>
-    </key>
-    <key>
-      <index>dc.title</index>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/10/08.xcql b/test/regression/sections/10/08.xcql
deleted file mode 100644 (file)
index bcf2a8f..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<searchClause>
-  <index>dc.creator</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>kernighan</term>
-  <sortKeys>
-    <key>
-      <index>dc.date</index>
-      <modifiers>
-        <modifier>
-          <type>sort.missingomit</type>
-        </modifier>
-      </modifiers>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/10/09.xcql b/test/regression/sections/10/09.xcql
deleted file mode 100644 (file)
index 8a60d51..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<searchClause>
-  <index>dc.creator</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>kernighan</term>
-  <sortKeys>
-    <key>
-      <index>dc.date</index>
-      <modifiers>
-        <modifier>
-          <type>sort.missingvalue</type>
-          <comparison>=</comparison>
-          <value>1970</value>
-        </modifier>
-      </modifiers>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/10/10.xcql b/test/regression/sections/10/10.xcql
deleted file mode 100644 (file)
index cb97df6..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<searchClause>
-  <prefixes>
-    <prefix>
-      <name>dc</name>
-      <identifier>http://deepcustard.org/1.0</identifier>
-    </prefix>
-  </prefixes>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>blah</term>
-  <sortKeys>
-    <key>
-      <index>dc.custardDepth</index>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/10/11.xcql b/test/regression/sections/10/11.xcql
deleted file mode 100644 (file)
index ba2abe7..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<searchClause>
-  <prefixes>
-    <prefix>
-      <name>ns1</name>
-      <identifier>http://uri1</identifier>
-    </prefix>
-    <prefix>
-      <name>ns2</name>
-      <identifier>http://uri2</identifier>
-    </prefix>
-  </prefixes>
-  <index>cql.serverChoice</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>whatever</term>
-  <sortKeys>
-    <key>
-      <index>ns1.key</index>
-      <modifiers>
-        <modifier>
-          <type>a</type>
-        </modifier>
-        <modifier>
-          <type>b</type>
-        </modifier>
-        <modifier>
-          <type>c</type>
-          <comparison>=</comparison>
-          <value>1</value>
-        </modifier>
-      </modifiers>
-    </key>
-    <key>
-      <index>ns2.key2</index>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/10/12.xcql b/test/regression/sections/10/12.xcql
deleted file mode 100644 (file)
index 06b0ac2..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<searchClause>
-  <prefixes>
-    <prefix>
-      <name>dc</name>
-      <identifier>x</identifier>
-    </prefix>
-  </prefixes>
-  <index>b</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>c</term>
-  <sortKeys>
-    <key>
-      <index>d</index>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/10/13.xcql b/test/regression/sections/10/13.xcql
deleted file mode 100644 (file)
index 06b0ac2..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<searchClause>
-  <prefixes>
-    <prefix>
-      <name>dc</name>
-      <identifier>x</identifier>
-    </prefix>
-  </prefixes>
-  <index>b</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>c</term>
-  <sortKeys>
-    <key>
-      <index>d</index>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/10/14.xcql b/test/regression/sections/10/14.xcql
deleted file mode 100644 (file)
index 4f9f6d2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<triple>
-  <prefixes>
-    <prefix>
-      <name>dc</name>
-      <identifier>x</identifier>
-    </prefix>
-  </prefixes>
-  <boolean>
-    <value>and</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>c1</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>c2</term>
-    </searchClause>
-  </rightOperand>
-  <sortKeys>
-    <key>
-      <index>d</index>
-    </key>
-  </sortKeys>
-</triple>
diff --git a/test/regression/sections/10/15.xcql b/test/regression/sections/10/15.xcql
deleted file mode 100644 (file)
index fb278bc..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<searchClause>
-  <prefixes>
-    <prefix>
-      <name>dc</name>
-      <identifier>http://deepcustard.org</identifier>
-    </prefix>
-    <prefix>
-      <name>dc</name>
-      <identifier>http://dublincore.org</identifier>
-    </prefix>
-  </prefixes>
-  <index>dc.title</index>
-  <relation>
-    <value>=</value>
-  </relation>
-  <term>jaws</term>
-  <sortKeys>
-    <key>
-      <index>dc.custardDepth</index>
-    </key>
-  </sortKeys>
-</searchClause>
diff --git a/test/regression/sections/10/16.xcql b/test/regression/sections/10/16.xcql
deleted file mode 100644 (file)
index 42b01d6..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<triple>
-  <prefixes>
-    <prefix>
-      <name>dc</name>
-      <identifier>http://deepcustard.org</identifier>
-    </prefix>
-  </prefixes>
-  <boolean>
-    <value>or</value>
-  </boolean>
-  <leftOperand>
-    <searchClause>
-      <index>cql.serverChoice</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>fish</term>
-    </searchClause>
-  </leftOperand>
-  <rightOperand>
-    <searchClause>
-      <prefixes>
-        <prefix>
-          <name>dc</name>
-          <identifier>http://dublincore.org</identifier>
-        </prefix>
-      </prefixes>
-      <index>dc.title</index>
-      <relation>
-        <value>=</value>
-      </relation>
-      <term>jaws</term>
-    </searchClause>
-  </rightOperand>
-  <sortKeys>
-    <key>
-      <index>dc.custardDepth</index>
-    </key>
-  </sortKeys>
-</triple>
diff --git a/test/regression/showtest b/test/regression/showtest
deleted file mode 100755 (executable)
index 0154d9d..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-
-if [ $# != 1 ]; then
-       echo "Usage: $0 <test-name>" >&2
-       echo "  e.g. $0 01/02" >&2
-       exit 1
-fi
-
-### Warning: nasty hard-coded choices
-( echo "=== Adam ==="
-  ../../../srw/cql/cql2xcql < sections/$1.cql ) > /tmp/adam
-( echo "=== Mike ==="
-  ../../bin/CQLParser < sections/$1.cql ) > /tmp/mike
-sdiff -w 80 /tmp/adam /tmp/mike
diff --git a/test/regression/xmlpp.pl b/test/regression/xmlpp.pl
deleted file mode 100755 (executable)
index 9e8abef..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-#!/usr/bin/perl  -w
-
-#
-#  Copyright (c) 2002, DecisionSoft Limited All rights reserved.
-#  Please see: 
-#  http://software.decisionsoft.com/license.html
-#  for more information.
-# 
-
-# $Revision: 1.2 $
-#
-# xmlpp: XML pretty printing
-#
-
-# For custom attribute sorting create an attributeOrdering.txt file that
-# lists each attributes separated by a newline in the order you would like
-# them to be sorted separated by a newline. Then use the -s option.
-
-use FileHandle;
-use Fcntl;
-use Getopt::Std;
-
-use vars qw($opt_h $opt_H $opt_s $opt_z $opt_t $opt_e $opt_S $opt_c $opt_n $opt_l);
-
-my $indent=0;
-my $textContent='';
-my $lastTag=undef;
-my $output;
-my $inAnnotation = 0;
-
-
-if (!getopts('nzhHsteScl:') or $opt_h) {
-    usage();
-}
-
-my $indentSize = $opt_l || 2;
-
-if ($opt_s){
-
-# expect to find attributeOrdering.txt file in same directory
-# as xmlpp is being run from
-    
-  my $scriptDir = $0;
-  if ($scriptDir =~ m#/#){
-    $scriptDir =~ s#/[^/]+$##;
-  }
-  else{
-    $scriptDir =".";
-  }
-    
-  # get attribute ordering from external file
-  if (open(SORTLIST, "<$scriptDir/attributeOrdering.txt")) {
-    @sortlist = <SORTLIST>;
-    chomp @sortlist;
-    close (SORTLIST);
-    @specialSort = grep(/^\w+/, @sortlist);
-  } 
-  else {      
-   print STDERR  "Could not open $scriptDir/attributeOrdering.txt: $!\nWARNING attribute sorting will only be alphabetic\n\n";
-  }
-}
-
-
-# set line separator to ">" speeding up parsing of XML files
-# with no line breaks 
-
-$/ = ">";
-
-
-my $sortAttributes = $opt_s;
-my $newLineComments = $opt_c;
-my $splitAttributes = $opt_t;
-my $schemaHackMode = $opt_S;
-my $normaliseWhiteSpace = $opt_n;
-
-my $filename = $ARGV[0];
-if ($opt_z && (!$filename or $filename eq '-')) {
-    print STDERR "Error: I can't edit STDIN in place.\n";
-    usage();
-}
-
-if (!$opt_z && scalar(@ARGV) > 1) {
-    print STDERR "Warning: Multiple files specified without -z option\n"; 
-}
-
-my $fh;
-
-my $stdin;
-
-if (!$filename or $filename eq '-') {
-    $fh=*STDIN;
-    $stdin=1;
-} else {
-    $fh = open_next_file() or exit(1);
-    $stdin=0;
-}
-
-do {
-    $indent=0;
-    $textContent='';
-    $lastTag=undef;
-    $output = '';
-    my $re_name = "(?:[A-Za-z0-9_:][A-Za-z0-9_:.-]*)";
-    my $re_attr = "(?:'[^']*'|\"[^\"]*\")";
-    my $input;
-
-    while ($input .= <$fh>) {
-        while ($input) {
-            if ($input =~ s/^<($re_name)((?:\s+$re_name\s*=\s*$re_attr)*\s*)(\/?)>(.*)$/$4/s ) {
-                my %attr;
-                my ($name,$attr,$selfclose) = ($1,$2,$3);
-                while ($attr =~ m/($re_name)\s*=\s*($re_attr)/gs) {
-                    my ($name,$value) = ($1,$2);
-                    $value =~ s/^["'](.*)["']$/$1/s;
-                    $attr{$name} = $value;
-                }
-                if ($opt_e) {
-                    parseStart($name, 0, %attr);
-                    if ($selfclose) { parseEnd($name) }
-                } else {
-                    parseStart($name, $selfclose, %attr);
-                }
-            } elsif ($input =~ s/^<\/($re_name)\s*>(.*)$/$2/s) {
-                parseEnd($1);
-            } elsif ($input =~ s/^<!--(.*?)-->(.*)$/$2/s) { 
-                parseComment($1);
-            } elsif ($input =~ s/^([^<]+)(.*)$/$2/s) {
-                parseDefault($1);
-            } elsif ($input =~ s/^(<\?[^>]*\?>)(.*)$/$2/s) {
-                parsePI("$1\n");
-            } elsif ($input =~ s/^(<\!DOCTYPE[^\[>]*(\[[^\]]*\])?[^>]*>)(.*)$/$3/s) {
-                parseDoctype("$1");
-            } else {
-                last;
-            }
-        }
-        if (eof($fh)) {
-            last;
-        }
-    }
-
-
-    if ($input) {
-        $input =~ m/([^\n]+)/gs;
-        print STDERR "WARNING: junk remaining on input: $1\n";
-    }
-    $fh->close();
-
-    if (!$opt_z) {
-        if(!$opt_H){ 
-            print "$output\n"
-        } else {
-            print html_escape($output)."\n"
-        }
-    } else {
-        if ($input) { 
-            print STDERR "Not overwriting file\n";
-        } else {
-            open FOUT,"> $filename" or die "Cannot overwrite file: $!";
-            if(!$opt_H){
-                print FOUT "$output\n"
-            } else {
-                print FOUT html_escape($output)."\n"
-            }
-            close FOUT
-        }
-    }
-} while (
-    !$stdin && $opt_z && ($fh = open_next_file(\$filename))
-  );
-  
-
-
-sub parseStart {
-    my $s = shift;
-    my $selfclose = shift;
-    my %attr = @_;
-
-    $textContent =~ s/\s+$//; 
-    printContent($textContent);
-
-    if($inAnnotation) {
-        return;
-    }
-
-    if($schemaHackMode and $s =~ m/(^|:)annotation$/) {
-        $inAnnotation = 1;
-        $textContent = '';
-        $lastTag = 1;
-        return;
-    }
-    if (length($output)) {
-        $output .= "\n";
-    }
-
-    $output .= " " x ($indent * $indentSize);
-    $output .= "<$s";
-    my @k = keys %attr;
-
-    if ($sortAttributes && (scalar(@k) > 1) ){
-
-      my @alphaSorted;
-      my @needSpecialSort;
-      my @final;
-      my $isSpecial;
-
-      # sort attributes alphabetically (default ordering)
-      @alphaSorted = sort @k;
-
-      # read through sorted list, if attribute doesn't have specified
-      # sort order, push it onto the end of the final array (this maintains
-      # alphabetic order). Else create a list that has attributes needing
-      # special ordering.
-      foreach $attribute (@alphaSorted){
-        $isSpecial = 0;
-        foreach $sortAttrib (@specialSort){
-          if ($attribute eq $sortAttrib){
-            push @needSpecialSort, $attribute;
-            $isSpecial = 1;
-          }
-        }
-        if (!$isSpecial){
-          push @final, $attribute;
-        }
-      }
-
-      # now read through the specialSort list backwards looking for
-      # any match in the needSpecialSort list. Unshift this onto the 
-      # front of the final array to maintain proper order.
-      foreach my $attribute (reverse @specialSort){
-        foreach (@needSpecialSort){
-          if ($attribute eq $_){
-            unshift @final, $attribute;
-          }
-        }
-      }
-
-      @k = @final;
-    }
-
-    foreach my $attr (@k) {
-        # 
-        # Remove (min|max)Occurs = 1 if schemaHackMode
-        #
-        if ($schemaHackMode and $attr =~ m/^(minOccurs|maxOccurs)$/ and $attr{$attr} eq "1") {
-            next;
-        }
-
-        if ($splitAttributes) {
-            $output .= "\n"." " x ($indent * $indentSize) ." ";
-        }
-        if ($attr{$attr} =~ /'/) {
-            $output .= " $attr=\"$attr{$attr}\"";
-        } else {
-            $output .= " $attr='$attr{$attr}'";
-        }
-    }
-    if ($splitAttributes and @k) {
-        $output .= "\n"." " x ($indent * $indentSize);
-    }
-    if ($selfclose) {
-        $output .= " />";
-        $lastTag = 0;
-    } else {
-        $output .= ">";
-        $indent++;
-        $lastTag = 1;
-    }
-    $textContent = '';
-}
-
-sub parseEnd {
-    my $s = shift;
-
-    if($inAnnotation) {
-        if($s =~ m/(^|:)annotation$/) {
-            $inAnnotation = 0;
-        }
-        return;
-    }
-
-    if($normaliseWhiteSpace) {
-        $textContent =~ s/^\s*(.*?)\s*$/$1/;
-    }
-    $indent--;
-    printContent($textContent);
-    if ($lastTag == 0) {
-        $output .= "\n";
-        $output .= " " x ($indent * $indentSize);
-    } 
-    $output .= "</$s>";
-    $textContent = '';
-    $lastTag = 0;
-}
-
-sub parseDefault {
-    my $s = shift;
-    if($inAnnotation) { return }
-    $textContent .= "$s";
-}
-
-sub parsePI {
-    my $s = shift;
-    $output .= "$s";
-}
-
-sub parseDoctype {
-    my $s = shift;
-    if ($s =~ /^([^\[]*\[)([^\]]*)(\].*)$/ms) {
-      $start = $1;
-      $DTD = $2;
-      $finish = $3;
-      $DTD =~ s/\</\n  \</msg;
-      $output .= "$start$DTD\n$finish\n";
-    } else {
-      $output .= "$s";
-    }
-}
-
-sub parseComment {
-    my $s = shift; 
-    if($inAnnotation) { return }
-    printContent($textContent,1);
-    if ($s =~ /([^\<]*)(<.*>)(.*)/ms) {
-      $start = $1;
-      $xml = $2;
-      $finish = $3;
-      $xml =~ s/\</\n\</msg;
-      $xml =~ s/(\n\s*\n?)+/\n/msg;
-      $xml =~ s/^\s*//msg;
-      $xml =~ s/\s*$//msg;
-      $s = "$start\n$xml\n$finish";
-    }
-    $s =~ s/\n\s*$/\n  /msg;
-    if ($newLineComments) {
-        $output .= "\n<!--$s-->\n";
-    } else {
-        $output .= "<!--$s-->";
-    }
-    $textContent='';
-}
-
-sub printContent {
-    my $s = shift;
-    my $printLF = shift;
-    my ($LF,$ret) = ("","");
-
-    if ($s =~ m/\n\s*$/) {
-        $LF = "\n"; 
-    }
-    if ($s =~ m/^[\s\n]*$/) {
-        $ret = undef;
-    } else {
-        $output .= "$s";
-        $ret = 1;
-    }
-    if ($printLF) {
-        $output .= $LF;
-    }
-}
-
-
-sub html_escape {
-    my $s = shift;
-    $s =~ s/&/&amp;/gsm;
-    $s =~ s/</&lt;/gsm;
-     $s =~ s/>/&gt;/gsm;
-    return $s;
-}
-
-sub open_next_file {
-    my $filename = shift;
-    $$filename = shift @ARGV;
-    while ($$filename and ! -f $$filename) {
-        print STDERR "WARNING: Could not find file: $$filename\n";
-        $$filename = shift @ARGV;
-    }
-    if(!$$filename) {
-        return undef;
-    }
-    my $fh = new FileHandle;
-    $fh->open("< $$filename") or die "Can't open $$filename: $!";
-    return $fh;
-}
-
-sub usage {
-    print STDERR <<EOF;
-usage: $0 [ options ] [ file.xml ... ]
-
-options:
-  -h  display this help message
-  -H  escape characters (useful for further processing)
-  -t  split attributes, one per line (useful for diff)
-  -s  sort attributes (useful for diff)
-  -z  in place edit (zap)
-  -e  expand self closing tags (useful for diff)
-  -S  schema hack mode (used by xmldiff)
-  -c  place comments on new line.
-  -n  normalise whitespace (remove leading and trailing whitespace from nodes
-      with text content.
-  -l <num>  Indent each level by <num> spaces [default: 2]
-EOF
-    exit 1;
-}
-
diff --git a/util/random/Makefile b/util/random/Makefile
new file mode 100644 (file)
index 0000000..d3e1421
--- /dev/null
@@ -0,0 +1,10 @@
+
+all: ../../target/cql-java-1.8.jar
+       PATH=$(PATH):../../bin CLASSPATH=../../target/cql-java-1.8.jar ./mkrandom 100
+
+../../target/cql-java-1.8.jar:
+       cd ../../ && mvn package
+
+clean:
+       @echo "Nothing to do to 'make clean'"
+
diff --git a/util/random/README b/util/random/README
new file mode 100644 (file)
index 0000000..586796b
--- /dev/null
@@ -0,0 +1,14 @@
+
+In this directory, we test the integrity of the CQL-Java tools as
+follows:
+
+* Generate a random tree with CQLGenerate
+* Take a copy
+* Canonicalise it with CQLparser -c.
+* Compare the before-and-after versions.
+
+Since the CQLGenerate output is in canonical form anyway, the
+before-and-after versions should be identical.  This process exercises
+the comprehensiveness and bullet-proofing of the parser, as well as
+the accuracy of the rendering.
+
diff --git a/util/random/mkrandom b/util/random/mkrandom
new file mode 100755 (executable)
index 0000000..131e9e7
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -w
+
+
+use strict;
+
+my $n = 1;
+if (@ARGV > 1) {
+    print STDERR "Usage: $0 [<number-of-trees>]\n";
+    exit 1;
+} elsif (@ARGV == 1) {
+    $n = $ARGV[0];
+}
+
+my $nok = 0;
+for (my $i = 0; $i < $n; $i++) {
+    print $i+1, " of $n -- ";
+    my $query=`CQLGenerator ../../etc/generate.properties`;
+    print $query;
+    my $canon=`CQLParser -c '$query'`;
+    if ($canon eq $query) {
+       $nok++;
+    } else {
+       print "ERROR: canonicalised query differs from original\n";
+    }
+}
+
+print "Passed $nok/$n -- ", int(100*$nok/$n), "%\n";
diff --git a/util/regression/Makefile b/util/regression/Makefile
new file mode 100644 (file)
index 0000000..5243e41
--- /dev/null
@@ -0,0 +1,30 @@
+
+XMLCANONICALISER = cat
+# Change this to "./xmlpp.pl" if you want to check for equivalence
+
+test: sections/01/01.cql sections/01/01.xcql
+       ./runtests ../../bin/CQLParser $(XMLCANONICALISER)
+
+test-adam: sections/01/01.cql sections/01/01.xcql
+       ./runtests ../../../srw/cql/cql2xcql $(XMLCANONICALISER)
+
+test-rob: sections/01/01.cql sections/01/01.xcql
+       ./runtests ../../../rob/CQLParser.py $(XMLCANONICALISER)
+
+sections/01/01.cql: mktests queries.raw
+       ./mktests queries.raw
+
+sections/01/01.xcql: mkanswers
+       ./mkanswers ../../bin/CQLParser
+# OR   ./mkanswers ../../../srw/cql/cql2xcql
+# OR   ./mkanswers ../../../rob/CQLParser.py
+# Depending on which parser you want to use as your reference
+
+clean:
+       @echo "Nothing to do to 'make clean'"
+
+distclean:
+       find sections . -name '*.cql' -exec rm \{\} \;
+
+refclean:
+       find sections . -name '*.xcql' -exec rm \{\} \;
diff --git a/util/regression/README b/util/regression/README
new file mode 100644 (file)
index 0000000..0d7b96b
--- /dev/null
@@ -0,0 +1,92 @@
+
+If you just don't want to think about it
+----------------------------------------
+
+Just use "make" to run regression tests.
+
+
+CQL-Java's regression-testing framework
+---------------------------------------
+
+"queries.raw" is the file of test queries as provided by Rob.
+"mktests" parses the raw file into sections and individual queries
+"sections" is the top-level directory created by that program.
+  "01", "02" etc. represent the sections within the raw file
+    "01/name", "02/name", etc. contain the names of the sections.
+    "01/01.cql", "01/02.cql" etc. are the CQL queries themselves.
+"mkanswers" uses a trusted CQL compiler to generate corresponding XCQL.
+    "01/01.xcql", "01/02.xcql" etc. are the compiled XCQL queries.
+
+Apart from the CQL files, all of the files described to this point are
+included in the distribution, with the "trusted" XCQL output produced
+by my own compiler, and used for regression testing of new versions.
+The CQL files are re-created from "queries.raw" as required.  But
+you're welcome to "make refclean" and rebuild it with mkanswers, to
+contain the trusted compiler output of your choice.
+
+"runtests" compares the output of a nominated CQL compiler with
+existing XCQL files.  Most often, you'll use this to compare the
+results of your own build of CQL-Java with those of my build.  I'll
+use it to test new versions, and people who've written other compilers
+can use it to test their code.  (The code of "runtests" and
+"mkanswers" is worryingly similar: they should probably be the same
+program invoked with different command-line arguments.)
+
+"Makefile" controls the building of all this.  You'll need to edit it
+if you want to use different compilers and suchlike from what's
+written into it, so it may be easier to run the tests by hand -- but
+it's a useful reference for the kinds of commands you might need,
+anyway.  In general, "make" will run the regression tests, creating
+whatever CQL and/or XCQL files it needs; if you do "make refclean"
+first, then the next "make" will rebuild the reference results.
+
+So, for example, if you think Rob Sanderson's parser, CQLParser.py, is
+reliable, and you want to test my parser, CQL-Java's CQLParser class,
+against its results, do this:
+
+       make refclean
+       ./mktests queries.raw
+       ./mkanswers CQLParser.py
+       ./runtests ../../bin/CQLParser ./xmlpp.pl
+
+The second argument to ./runtests is the name of a program to use to
+normalise XML, so that the trusted output and the output being tested
+can be compared for equivalence rather than just for being
+byte-identical.  (If you want to test for byte-identical XCQL, then
+use "cat" as the second argument.)  xmlpp.pl is a fine XML
+pretty-printer from DecisionSoft, found at
+       http://software.decisionsoft.com/tools.html
+
+"showtest" can be used to run a single test showing more details of
+what goes wrong, if anything.  You don't need it as part of the
+regression test, but it's useful when debugging.
+
+Finally, "runcanon" checks that each of the queries when compiled and
+decompiled back to CQL (i.e. canonicalised) remains identical when
+recompiled and redecompiled.
+
+
+Appendix: queries that should fail
+----------------------------------
+
+The following queries are included in Rob's master list, in a final
+section called "Invalid searches [should error]".  They are all
+expected to fail in various ways.  I've taken them out of
+"queries.raw" because it's uninteresting, not to mention rather
+disturbing, to watch compilers fail.  More important, I think, to
+demonstrate correct behaviour for the known-to-work queries.
+
+>
+===
+cat or
+index any 
+index any/wrong term
+a prox/wrong b
+()
+(a
+index any fish)
+(cat any dog or ())
+title = ("illegal parentheses")
+"quoted" any "illegal quotes"
+> illegal="urn:missingQuery"
+"fish" and > illegal="urn:invalidPrefixLocation" "chips"
diff --git a/util/regression/mkanswers b/util/regression/mkanswers
new file mode 100755 (executable)
index 0000000..16e7dd2
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/perl -w
+
+
+use IO::File;
+use strict;
+
+$ENV{CLASSPATH} .= ":../../lib/cql-java.jar";
+
+if (@ARGV != 1) {
+    print STDERR "Usage: $0 <trusted-CQL-compiler>\n";
+    exit(1);
+}
+my $compiler = $ARGV[0];
+
+while (<sections/*>) {
+    my $sdir = $_;
+    s@sections/@@;
+    next if /^CVS$/ || /^10$/; # I _can't_ get CVS to stop extracting "10"
+    print "answering section $_ - ", read_file("$sdir/name"), "\n";
+
+    while (<$sdir/*.cql>) {
+       my $qfile = $_;
+       s@sections/([0-9]+/.*)\.cql@$1@;
+       my $query = read_file($qfile);
+       my $afile = $qfile;
+       $afile =~ s/\.cql$/.xcql/;
+       print "  wrote $_ - $query\n";
+       my $fh = new IO::File("| $compiler > $afile")
+           or die "can't run compiler '$compiler': $!";
+       print $fh $query;
+       $fh->close();
+    }
+}
+
+sub read_file {
+    my($name) = @_;
+
+    my $fh = new IO::File("<$name")
+       or die "can't read '$name': $!";
+    my $contents = join('', <$fh>);
+    $fh->close();
+    return $contents;
+}
diff --git a/util/regression/mktests b/util/regression/mktests
new file mode 100755 (executable)
index 0000000..78057b0
--- /dev/null
@@ -0,0 +1,55 @@
+#!/usr/bin/perl -w
+
+
+use IO::File;
+use strict;
+
+maybe_mkdir("sections");
+my $section = 0;
+my $dir;
+my $query;
+
+while (<>) {
+    chomp();
+    s/[ \t]+$//;
+    next if /^$/;
+
+    if (s/^#[ \t]*//) {
+       $section++;
+       $query = 0;
+       $dir = "sections/" . substr("0$section", -2);
+       maybe_mkdir($dir);
+       write_file("$dir/name", $_);
+       print "created section $section ($dir) - $_\n";
+       next;
+    }
+
+    die "query before first section header"
+       if !defined $dir;
+
+    $query++;
+    my $filename = $dir . "/" . substr("0$query", -2) . ".cql";
+    write_file($filename, $_);
+    $filename =~ s@sections/(.*)\.cql@$1@;
+    print "  added $filename - $_\n";
+}
+
+sub write_file {
+    my($name, $contents) = @_;
+
+    my $fh = new IO::File(">$name")
+       or die "can't create '$name': $!";
+    $fh->print($contents);
+    $fh->close();
+}
+
+sub maybe_mkdir {
+    my($dir) = shift();
+    if (mkdir $dir) {
+       return;
+    }
+    if ($! =~ /exists/i) {
+       return;
+    }
+    die "can't create directory '$dir': $!";
+}
diff --git a/util/regression/queries.raw b/util/regression/queries.raw
new file mode 100644 (file)
index 0000000..6075e69
--- /dev/null
@@ -0,0 +1,112 @@
+
+# Simple 
+
+cat
+"cat"
+comp.os.linux
+xml:element
+"<xml:element>"
+"="
+"prox/distance<3/unit=word"
+("cat")
+((dog))
+all
+prox
+
+# Index Relation Term
+
+title = "fish"
+title exact fish
+title any fish
+title all fish
+title > 9
+title >= 23
+dc.title any "fish chips"
+dc.title any/stem fish
+dc.fish all/stem/fuzzy "fish chips"
+(title any frog)
+((dc.title any/stem "frog pond"))
+dc.title any "fish frog chicken"
+dc.title =/rel.algorithm=CORI squid
+author any/f.foo/b.bar>1 "sanderson taylor"
+numberOfLegs <= 4
+numberOfLegs <> 4
+title == jaws
+
+# Simple Boolean
+
+cat or dog
+cat and fish
+cat not frog
+(cat not frog)
+"cat" not "fish food"
+xml and "prox///"
+fred and any
+((fred or all))
+a or b and c not d
+
+# I/R/T plus Boolean
+
+bath.author any fish and dc.title all "cat dog"
+(title any/stem "fish dog" or and)
+
+# Prox
+
+cat prox hat
+cat prox/distance=3/unit=word/ordered hat
+cat prox/distance<3 hat
+"fish food" prox/unit=sentence and
+title all "chips frog" prox/distance<=5 exact
+(dc.author == "jones" prox/distance>5/unit=element title >= "smith")
+((cat prox hat))
+a and/rel.SumOfScores b
+a and/rel.algorithm=CORI b
+
+# Special Characters
+
+(cat^)
+"cat"
+"^cat says \"fish\""
+"cat*fish"
+cat?dog
+(("^cat*fishdog\"horse?"))
+
+# Nesting Parentheses
+
+(((cat or dog) or horse) and frog)
+(cat and dog) or (horse and frog)
+(cat and (horse or frog)) and chips
+
+# Prefix Maps
+
+> foo="http://www.loc.gov/zing/cql/dc-indexes/" dc.title="fish"
+> "http://www.loc.gov/zing/cql/dc-indexes/" title="fish"
+> foo="http://www.loc.gov/zing/cql/dc-indexes" > ccg = "http://srw.o-r-g.org/cql/indexSets/ccg/" foo.title="fish" and ccg.force=3
+
+# Lame Searches
+
+any or all:stem and all contains any prox proxfuzzy
+(((((((((any)))))))))
+""
+> any > any = exact any > any
+sortby sortby sortby
+sortby sortby sortby sortby sortby
+
+# Sorting
+
+kernighan sortby title
+kernighan and ritchie sortby title
+dc.creator=kernighan sortby dc.title
+dc.creator=kernighan sortby numberOfLegs/cql.number
+dc.creator=kernighan sortby dc.title/sort.respectCase
+dc.creator=kernighan sortby dc.title/sort.respectCase/sort.descending
+dc.creator=kernighan sortby dc.date dc.title
+dc.creator=kernighan sortby dc.date/sort.missingOmit
+dc.creator=kernighan sortby dc.date/sort.missingValue=1970
+>dc="http://deepcustard.org/1.0" blah sortby dc.custardDepth
+>ns1="http://uri1" >ns2="http://uri2" whatever sortby ns1.key/a/b/c=1 ns2.key2
+(>dc=x b=c) sortby d
+b=(>dc=x c) sortby d
+(>dc=x c1 and c2) sortby d
+>dc="http://deepcustard.org" (>dc="http://dublincore.org" dc.title=jaws) sortby dc.custardDepth
+>dc="http://deepcustard.org" (fish or >dc="http://dublincore.org" dc.title=jaws) sortby dc.custardDepth
diff --git a/util/regression/runcanon b/util/regression/runcanon
new file mode 100755 (executable)
index 0000000..46d6a93
--- /dev/null
@@ -0,0 +1,51 @@
+#!/usr/bin/perl -w
+
+#
+# Tests that all sample queries can be rendered into idempotent
+# canoncial form.
+
+use IO::File;
+use strict;
+
+$ENV{CLASSPATH} .= ":../../lib/cql-java.jar";
+
+my($ntests, $ncorrect) = (0, 0);
+
+while (<sections/*>) {
+    my $sdir = $_;
+    s@sections/@@;
+    next if /^CVS$/ || /^10$/;
+    print "testing section $_ - ", read_file("$sdir/name"), "\n";
+
+    while (<$sdir/*.cql>) {
+       my $qfile = $_;
+       s@sections/([0-9]+/.*)\.cql@$1@;
+       my $query = read_file($qfile);
+       my $canonical = `CQLParser -c '$query'`;
+       chomp($canonical);
+       my $maybe = `CQLParser -c '$canonical'`;
+       chomp($maybe);
+       print "$query // $canonical ";
+       $ntests++;
+       if ($maybe eq $canonical) {
+           $ncorrect++;
+           print " OK\n";
+       } else {
+           print "### $maybe\n";
+       }
+    }
+}
+
+print sprintf("%d of %d passed: %d%%\n",
+             $ncorrect, $ntests, (100 * $ncorrect) / $ntests);
+
+sub read_file {
+    my($name) = @_;
+
+    $name = "<$name" if $name !~ /\|$/;
+    my $fh = new IO::File("$name")
+       or die "can't read '$name': $!";
+    my $contents = join('', <$fh>);
+    $fh->close();
+    return $contents;
+}
diff --git a/util/regression/runtests b/util/regression/runtests
new file mode 100755 (executable)
index 0000000..c12cd3c
--- /dev/null
@@ -0,0 +1,59 @@
+#!/usr/bin/perl -w
+
+
+use IO::File;
+use strict;
+
+$ENV{CLASSPATH} .= ":../../src/main/java";
+$ENV{CLASSPATH} .= ":../../lib/cql-java.jar";
+
+if (@ARGV != 2) {
+    print STDERR "Usage: $0 <CQL-compiler> <XML-normaliser>\n";
+    exit(1);
+}
+my $compiler = $ARGV[0];
+my $norman = $ARGV[1];         # name of XML normaliser program
+my($ntests, $ncorrect) = (0, 0);
+
+while (<sections/*>) {
+    my $sdir = $_;
+    s@sections/@@;
+    next if /^CVS$/;
+    print "testing section $_ - ", read_file("$sdir/name"), "\n";
+
+    while (<$sdir/*.cql>) {
+       my $qfile = $_;
+       s@sections/([0-9]+/.*)\.cql@$1@;
+       my $query = read_file($qfile);
+       my $afile = $qfile;
+       $afile =~ s/\.cql$/.xcql/;
+       print "  query $_ - $query  ";
+       $ntests++;
+       my $correct = read_file("$norman < $afile |");
+       my $tested = read_file("$compiler < $qfile | $norman |");
+       if (!$tested) {
+           print "\n    *** test compiler exited non-zero\n";
+       } elsif ($tested eq $correct) {
+           print "OK\n";
+           $ncorrect++;
+       } else {
+           print "\n    *** XCQL output differs from $afile\n";
+           print "=== tested ===\n$tested";
+           print "=== end ===\n";
+       }
+    }
+}
+
+print sprintf("%d of %d passed: %d%%\n",
+             $ncorrect, $ntests, (100 * $ncorrect) / $ntests);
+
+sub read_file {
+    my($name) = @_;
+
+    $name = "<$name" if $name !~ /\|$/;
+    my $fh = new IO::File("$name")
+       or die "can't read '$name': $!";
+    my $contents = join('', <$fh>);
+    $fh->close();
+    return $contents;
+}
diff --git a/util/regression/sections/01/.gitignore b/util/regression/sections/01/.gitignore
new file mode 100644 (file)
index 0000000..b03b3d1
--- /dev/null
@@ -0,0 +1,2 @@
+name
+*.cql
diff --git a/util/regression/sections/01/01.xcql b/util/regression/sections/01/01.xcql
new file mode 100644 (file)
index 0000000..48aee99
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>cat</term>
+</searchClause>
diff --git a/util/regression/sections/01/02.xcql b/util/regression/sections/01/02.xcql
new file mode 100644 (file)
index 0000000..48aee99
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>cat</term>
+</searchClause>
diff --git a/util/regression/sections/01/03.xcql b/util/regression/sections/01/03.xcql
new file mode 100644 (file)
index 0000000..af191d3
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>comp.os.linux</term>
+</searchClause>
diff --git a/util/regression/sections/01/04.xcql b/util/regression/sections/01/04.xcql
new file mode 100644 (file)
index 0000000..4141430
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>xml:element</term>
+</searchClause>
diff --git a/util/regression/sections/01/05.xcql b/util/regression/sections/01/05.xcql
new file mode 100644 (file)
index 0000000..6ec410e
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>&lt;xml:element&gt;</term>
+</searchClause>
diff --git a/util/regression/sections/01/06.xcql b/util/regression/sections/01/06.xcql
new file mode 100644 (file)
index 0000000..da69755
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>=</term>
+</searchClause>
diff --git a/util/regression/sections/01/07.xcql b/util/regression/sections/01/07.xcql
new file mode 100644 (file)
index 0000000..851a5c1
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>prox/distance&lt;3/unit=word</term>
+</searchClause>
diff --git a/util/regression/sections/01/08.xcql b/util/regression/sections/01/08.xcql
new file mode 100644 (file)
index 0000000..48aee99
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>cat</term>
+</searchClause>
diff --git a/util/regression/sections/01/09.xcql b/util/regression/sections/01/09.xcql
new file mode 100644 (file)
index 0000000..d41b39e
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>dog</term>
+</searchClause>
diff --git a/util/regression/sections/01/10.xcql b/util/regression/sections/01/10.xcql
new file mode 100644 (file)
index 0000000..c5ac7f6
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>all</term>
+</searchClause>
diff --git a/util/regression/sections/01/11.xcql b/util/regression/sections/01/11.xcql
new file mode 100644 (file)
index 0000000..88da9eb
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>prox</term>
+</searchClause>
diff --git a/util/regression/sections/02/.gitignore b/util/regression/sections/02/.gitignore
new file mode 100644 (file)
index 0000000..b03b3d1
--- /dev/null
@@ -0,0 +1,2 @@
+name
+*.cql
diff --git a/util/regression/sections/02/01.xcql b/util/regression/sections/02/01.xcql
new file mode 100644 (file)
index 0000000..be3c9c1
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>title</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>fish</term>
+</searchClause>
diff --git a/util/regression/sections/02/02.xcql b/util/regression/sections/02/02.xcql
new file mode 100644 (file)
index 0000000..2b78ddf
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>title</index>
+  <relation>
+    <value>exact</value>
+  </relation>
+  <term>fish</term>
+</searchClause>
diff --git a/util/regression/sections/02/03.xcql b/util/regression/sections/02/03.xcql
new file mode 100644 (file)
index 0000000..62521be
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>title</index>
+  <relation>
+    <value>any</value>
+  </relation>
+  <term>fish</term>
+</searchClause>
diff --git a/util/regression/sections/02/04.xcql b/util/regression/sections/02/04.xcql
new file mode 100644 (file)
index 0000000..646c973
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>title</index>
+  <relation>
+    <value>all</value>
+  </relation>
+  <term>fish</term>
+</searchClause>
diff --git a/util/regression/sections/02/05.xcql b/util/regression/sections/02/05.xcql
new file mode 100644 (file)
index 0000000..92411c4
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>title</index>
+  <relation>
+    <value>&gt;</value>
+  </relation>
+  <term>9</term>
+</searchClause>
diff --git a/util/regression/sections/02/06.xcql b/util/regression/sections/02/06.xcql
new file mode 100644 (file)
index 0000000..6702471
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>title</index>
+  <relation>
+    <value>&gt;=</value>
+  </relation>
+  <term>23</term>
+</searchClause>
diff --git a/util/regression/sections/02/07.xcql b/util/regression/sections/02/07.xcql
new file mode 100644 (file)
index 0000000..ba4ac78
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>dc.title</index>
+  <relation>
+    <value>any</value>
+  </relation>
+  <term>fish chips</term>
+</searchClause>
diff --git a/util/regression/sections/02/08.xcql b/util/regression/sections/02/08.xcql
new file mode 100644 (file)
index 0000000..1576778
--- /dev/null
@@ -0,0 +1,12 @@
+<searchClause>
+  <index>dc.title</index>
+  <relation>
+    <value>any</value>
+    <modifiers>
+      <modifier>
+        <type>stem</type>
+      </modifier>
+    </modifiers>
+  </relation>
+  <term>fish</term>
+</searchClause>
diff --git a/util/regression/sections/02/09.xcql b/util/regression/sections/02/09.xcql
new file mode 100644 (file)
index 0000000..9f8abff
--- /dev/null
@@ -0,0 +1,15 @@
+<searchClause>
+  <index>dc.fish</index>
+  <relation>
+    <value>all</value>
+    <modifiers>
+      <modifier>
+        <type>stem</type>
+      </modifier>
+      <modifier>
+        <type>fuzzy</type>
+      </modifier>
+    </modifiers>
+  </relation>
+  <term>fish chips</term>
+</searchClause>
diff --git a/util/regression/sections/02/10.xcql b/util/regression/sections/02/10.xcql
new file mode 100644 (file)
index 0000000..d7dfe7a
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>title</index>
+  <relation>
+    <value>any</value>
+  </relation>
+  <term>frog</term>
+</searchClause>
diff --git a/util/regression/sections/02/11.xcql b/util/regression/sections/02/11.xcql
new file mode 100644 (file)
index 0000000..726a36e
--- /dev/null
@@ -0,0 +1,12 @@
+<searchClause>
+  <index>dc.title</index>
+  <relation>
+    <value>any</value>
+    <modifiers>
+      <modifier>
+        <type>stem</type>
+      </modifier>
+    </modifiers>
+  </relation>
+  <term>frog pond</term>
+</searchClause>
diff --git a/util/regression/sections/02/12.xcql b/util/regression/sections/02/12.xcql
new file mode 100644 (file)
index 0000000..b4bcf3b
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>dc.title</index>
+  <relation>
+    <value>any</value>
+  </relation>
+  <term>fish frog chicken</term>
+</searchClause>
diff --git a/util/regression/sections/02/13.xcql b/util/regression/sections/02/13.xcql
new file mode 100644 (file)
index 0000000..6f3c011
--- /dev/null
@@ -0,0 +1,14 @@
+<searchClause>
+  <index>dc.title</index>
+  <relation>
+    <value>=</value>
+    <modifiers>
+      <modifier>
+        <type>rel.algorithm</type>
+        <comparison>=</comparison>
+        <value>CORI</value>
+      </modifier>
+    </modifiers>
+  </relation>
+  <term>squid</term>
+</searchClause>
diff --git a/util/regression/sections/02/14.xcql b/util/regression/sections/02/14.xcql
new file mode 100644 (file)
index 0000000..c833d26
--- /dev/null
@@ -0,0 +1,17 @@
+<searchClause>
+  <index>author</index>
+  <relation>
+    <value>any</value>
+    <modifiers>
+      <modifier>
+        <type>f.foo</type>
+      </modifier>
+      <modifier>
+        <type>b.bar</type>
+        <comparison>&gt;</comparison>
+        <value>1</value>
+      </modifier>
+    </modifiers>
+  </relation>
+  <term>sanderson taylor</term>
+</searchClause>
diff --git a/util/regression/sections/02/15.xcql b/util/regression/sections/02/15.xcql
new file mode 100644 (file)
index 0000000..3a23abe
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>numberOfLegs</index>
+  <relation>
+    <value>&lt;=</value>
+  </relation>
+  <term>4</term>
+</searchClause>
diff --git a/util/regression/sections/02/16.xcql b/util/regression/sections/02/16.xcql
new file mode 100644 (file)
index 0000000..0e8eccd
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>numberOfLegs</index>
+  <relation>
+    <value>&lt;&gt;</value>
+  </relation>
+  <term>4</term>
+</searchClause>
diff --git a/util/regression/sections/02/17.xcql b/util/regression/sections/02/17.xcql
new file mode 100644 (file)
index 0000000..b2587ff
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>title</index>
+  <relation>
+    <value>==</value>
+  </relation>
+  <term>jaws</term>
+</searchClause>
diff --git a/util/regression/sections/03/.gitignore b/util/regression/sections/03/.gitignore
new file mode 100644 (file)
index 0000000..b03b3d1
--- /dev/null
@@ -0,0 +1,2 @@
+name
+*.cql
diff --git a/util/regression/sections/03/01.xcql b/util/regression/sections/03/01.xcql
new file mode 100644 (file)
index 0000000..fc1b678
--- /dev/null
@@ -0,0 +1,23 @@
+<triple>
+  <boolean>
+    <value>or</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>cat</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>dog</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/03/02.xcql b/util/regression/sections/03/02.xcql
new file mode 100644 (file)
index 0000000..55ae66a
--- /dev/null
@@ -0,0 +1,23 @@
+<triple>
+  <boolean>
+    <value>and</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>cat</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>fish</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/03/03.xcql b/util/regression/sections/03/03.xcql
new file mode 100644 (file)
index 0000000..2f4f6c0
--- /dev/null
@@ -0,0 +1,23 @@
+<triple>
+  <boolean>
+    <value>not</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>cat</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>frog</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/03/04.xcql b/util/regression/sections/03/04.xcql
new file mode 100644 (file)
index 0000000..2f4f6c0
--- /dev/null
@@ -0,0 +1,23 @@
+<triple>
+  <boolean>
+    <value>not</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>cat</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>frog</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/03/05.xcql b/util/regression/sections/03/05.xcql
new file mode 100644 (file)
index 0000000..9ad0700
--- /dev/null
@@ -0,0 +1,23 @@
+<triple>
+  <boolean>
+    <value>not</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>cat</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>fish food</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/03/06.xcql b/util/regression/sections/03/06.xcql
new file mode 100644 (file)
index 0000000..7b8dae8
--- /dev/null
@@ -0,0 +1,23 @@
+<triple>
+  <boolean>
+    <value>and</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>xml</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>prox///</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/03/07.xcql b/util/regression/sections/03/07.xcql
new file mode 100644 (file)
index 0000000..5e0076e
--- /dev/null
@@ -0,0 +1,23 @@
+<triple>
+  <boolean>
+    <value>and</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>fred</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>any</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/03/08.xcql b/util/regression/sections/03/08.xcql
new file mode 100644 (file)
index 0000000..f080d4b
--- /dev/null
@@ -0,0 +1,23 @@
+<triple>
+  <boolean>
+    <value>or</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>fred</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>all</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/03/09.xcql b/util/regression/sections/03/09.xcql
new file mode 100644 (file)
index 0000000..4f3ade7
--- /dev/null
@@ -0,0 +1,55 @@
+<triple>
+  <boolean>
+    <value>not</value>
+  </boolean>
+  <leftOperand>
+    <triple>
+      <boolean>
+        <value>and</value>
+      </boolean>
+      <leftOperand>
+        <triple>
+          <boolean>
+            <value>or</value>
+          </boolean>
+          <leftOperand>
+            <searchClause>
+              <index>cql.serverChoice</index>
+              <relation>
+                <value>=</value>
+              </relation>
+              <term>a</term>
+            </searchClause>
+          </leftOperand>
+          <rightOperand>
+            <searchClause>
+              <index>cql.serverChoice</index>
+              <relation>
+                <value>=</value>
+              </relation>
+              <term>b</term>
+            </searchClause>
+          </rightOperand>
+        </triple>
+      </leftOperand>
+      <rightOperand>
+        <searchClause>
+          <index>cql.serverChoice</index>
+          <relation>
+            <value>=</value>
+          </relation>
+          <term>c</term>
+        </searchClause>
+      </rightOperand>
+    </triple>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>d</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/04/.gitignore b/util/regression/sections/04/.gitignore
new file mode 100644 (file)
index 0000000..b03b3d1
--- /dev/null
@@ -0,0 +1,2 @@
+name
+*.cql
diff --git a/util/regression/sections/04/01.xcql b/util/regression/sections/04/01.xcql
new file mode 100644 (file)
index 0000000..6f3ec27
--- /dev/null
@@ -0,0 +1,23 @@
+<triple>
+  <boolean>
+    <value>and</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>bath.author</index>
+      <relation>
+        <value>any</value>
+      </relation>
+      <term>fish</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>dc.title</index>
+      <relation>
+        <value>all</value>
+      </relation>
+      <term>cat dog</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/04/02.xcql b/util/regression/sections/04/02.xcql
new file mode 100644 (file)
index 0000000..0dcb869
--- /dev/null
@@ -0,0 +1,28 @@
+<triple>
+  <boolean>
+    <value>or</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>title</index>
+      <relation>
+        <value>any</value>
+        <modifiers>
+          <modifier>
+            <type>stem</type>
+          </modifier>
+        </modifiers>
+      </relation>
+      <term>fish dog</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>and</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/05/.gitignore b/util/regression/sections/05/.gitignore
new file mode 100644 (file)
index 0000000..b03b3d1
--- /dev/null
@@ -0,0 +1,2 @@
+name
+*.cql
diff --git a/util/regression/sections/05/01.xcql b/util/regression/sections/05/01.xcql
new file mode 100644 (file)
index 0000000..406d103
--- /dev/null
@@ -0,0 +1,23 @@
+<triple>
+  <boolean>
+    <value>prox</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>cat</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>hat</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/05/02.xcql b/util/regression/sections/05/02.xcql
new file mode 100644 (file)
index 0000000..f09ab0b
--- /dev/null
@@ -0,0 +1,38 @@
+<triple>
+  <boolean>
+    <value>prox</value>
+    <modifiers>
+      <modifier>
+        <type>distance</type>
+        <comparison>=</comparison>
+        <value>3</value>
+      </modifier>
+      <modifier>
+        <type>unit</type>
+        <comparison>=</comparison>
+        <value>word</value>
+      </modifier>
+      <modifier>
+        <type>ordered</type>
+      </modifier>
+    </modifiers>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>cat</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>hat</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/05/03.xcql b/util/regression/sections/05/03.xcql
new file mode 100644 (file)
index 0000000..25c5377
--- /dev/null
@@ -0,0 +1,30 @@
+<triple>
+  <boolean>
+    <value>prox</value>
+    <modifiers>
+      <modifier>
+        <type>distance</type>
+        <comparison>&lt;</comparison>
+        <value>3</value>
+      </modifier>
+    </modifiers>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>cat</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>hat</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/05/04.xcql b/util/regression/sections/05/04.xcql
new file mode 100644 (file)
index 0000000..a6e2198
--- /dev/null
@@ -0,0 +1,30 @@
+<triple>
+  <boolean>
+    <value>prox</value>
+    <modifiers>
+      <modifier>
+        <type>unit</type>
+        <comparison>=</comparison>
+        <value>sentence</value>
+      </modifier>
+    </modifiers>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>fish food</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>and</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/05/05.xcql b/util/regression/sections/05/05.xcql
new file mode 100644 (file)
index 0000000..a59341f
--- /dev/null
@@ -0,0 +1,30 @@
+<triple>
+  <boolean>
+    <value>prox</value>
+    <modifiers>
+      <modifier>
+        <type>distance</type>
+        <comparison>&lt;=</comparison>
+        <value>5</value>
+      </modifier>
+    </modifiers>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>title</index>
+      <relation>
+        <value>all</value>
+      </relation>
+      <term>chips frog</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>exact</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/05/06.xcql b/util/regression/sections/05/06.xcql
new file mode 100644 (file)
index 0000000..4ffea29
--- /dev/null
@@ -0,0 +1,35 @@
+<triple>
+  <boolean>
+    <value>prox</value>
+    <modifiers>
+      <modifier>
+        <type>distance</type>
+        <comparison>&gt;</comparison>
+        <value>5</value>
+      </modifier>
+      <modifier>
+        <type>unit</type>
+        <comparison>=</comparison>
+        <value>element</value>
+      </modifier>
+    </modifiers>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>dc.author</index>
+      <relation>
+        <value>==</value>
+      </relation>
+      <term>jones</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>title</index>
+      <relation>
+        <value>&gt;=</value>
+      </relation>
+      <term>smith</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/05/07.xcql b/util/regression/sections/05/07.xcql
new file mode 100644 (file)
index 0000000..406d103
--- /dev/null
@@ -0,0 +1,23 @@
+<triple>
+  <boolean>
+    <value>prox</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>cat</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>hat</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/05/08.xcql b/util/regression/sections/05/08.xcql
new file mode 100644 (file)
index 0000000..b46dcfd
--- /dev/null
@@ -0,0 +1,28 @@
+<triple>
+  <boolean>
+    <value>and</value>
+    <modifiers>
+      <modifier>
+        <type>rel.sumofscores</type>
+      </modifier>
+    </modifiers>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>a</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>b</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/05/09.xcql b/util/regression/sections/05/09.xcql
new file mode 100644 (file)
index 0000000..1dc3602
--- /dev/null
@@ -0,0 +1,30 @@
+<triple>
+  <boolean>
+    <value>and</value>
+    <modifiers>
+      <modifier>
+        <type>rel.algorithm</type>
+        <comparison>=</comparison>
+        <value>CORI</value>
+      </modifier>
+    </modifiers>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>a</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>b</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/06/.gitignore b/util/regression/sections/06/.gitignore
new file mode 100644 (file)
index 0000000..b03b3d1
--- /dev/null
@@ -0,0 +1,2 @@
+name
+*.cql
diff --git a/util/regression/sections/06/01.xcql b/util/regression/sections/06/01.xcql
new file mode 100644 (file)
index 0000000..0dcc5fb
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>cat^</term>
+</searchClause>
diff --git a/util/regression/sections/06/02.xcql b/util/regression/sections/06/02.xcql
new file mode 100644 (file)
index 0000000..48aee99
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>cat</term>
+</searchClause>
diff --git a/util/regression/sections/06/03.xcql b/util/regression/sections/06/03.xcql
new file mode 100644 (file)
index 0000000..9db40ae
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>^cat says "fish"</term>
+</searchClause>
diff --git a/util/regression/sections/06/04.xcql b/util/regression/sections/06/04.xcql
new file mode 100644 (file)
index 0000000..ee38b0e
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>cat*fish</term>
+</searchClause>
diff --git a/util/regression/sections/06/05.xcql b/util/regression/sections/06/05.xcql
new file mode 100644 (file)
index 0000000..dc59539
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>cat?dog</term>
+</searchClause>
diff --git a/util/regression/sections/06/06.xcql b/util/regression/sections/06/06.xcql
new file mode 100644 (file)
index 0000000..9d38695
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>^cat*fishdog"horse?</term>
+</searchClause>
diff --git a/util/regression/sections/07/.gitignore b/util/regression/sections/07/.gitignore
new file mode 100644 (file)
index 0000000..b03b3d1
--- /dev/null
@@ -0,0 +1,2 @@
+name
+*.cql
diff --git a/util/regression/sections/07/01.xcql b/util/regression/sections/07/01.xcql
new file mode 100644 (file)
index 0000000..3338a9f
--- /dev/null
@@ -0,0 +1,55 @@
+<triple>
+  <boolean>
+    <value>and</value>
+  </boolean>
+  <leftOperand>
+    <triple>
+      <boolean>
+        <value>or</value>
+      </boolean>
+      <leftOperand>
+        <triple>
+          <boolean>
+            <value>or</value>
+          </boolean>
+          <leftOperand>
+            <searchClause>
+              <index>cql.serverChoice</index>
+              <relation>
+                <value>=</value>
+              </relation>
+              <term>cat</term>
+            </searchClause>
+          </leftOperand>
+          <rightOperand>
+            <searchClause>
+              <index>cql.serverChoice</index>
+              <relation>
+                <value>=</value>
+              </relation>
+              <term>dog</term>
+            </searchClause>
+          </rightOperand>
+        </triple>
+      </leftOperand>
+      <rightOperand>
+        <searchClause>
+          <index>cql.serverChoice</index>
+          <relation>
+            <value>=</value>
+          </relation>
+          <term>horse</term>
+        </searchClause>
+      </rightOperand>
+    </triple>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>frog</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/07/02.xcql b/util/regression/sections/07/02.xcql
new file mode 100644 (file)
index 0000000..1324889
--- /dev/null
@@ -0,0 +1,55 @@
+<triple>
+  <boolean>
+    <value>or</value>
+  </boolean>
+  <leftOperand>
+    <triple>
+      <boolean>
+        <value>and</value>
+      </boolean>
+      <leftOperand>
+        <searchClause>
+          <index>cql.serverChoice</index>
+          <relation>
+            <value>=</value>
+          </relation>
+          <term>cat</term>
+        </searchClause>
+      </leftOperand>
+      <rightOperand>
+        <searchClause>
+          <index>cql.serverChoice</index>
+          <relation>
+            <value>=</value>
+          </relation>
+          <term>dog</term>
+        </searchClause>
+      </rightOperand>
+    </triple>
+  </leftOperand>
+  <rightOperand>
+    <triple>
+      <boolean>
+        <value>and</value>
+      </boolean>
+      <leftOperand>
+        <searchClause>
+          <index>cql.serverChoice</index>
+          <relation>
+            <value>=</value>
+          </relation>
+          <term>horse</term>
+        </searchClause>
+      </leftOperand>
+      <rightOperand>
+        <searchClause>
+          <index>cql.serverChoice</index>
+          <relation>
+            <value>=</value>
+          </relation>
+          <term>frog</term>
+        </searchClause>
+      </rightOperand>
+    </triple>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/07/03.xcql b/util/regression/sections/07/03.xcql
new file mode 100644 (file)
index 0000000..202af98
--- /dev/null
@@ -0,0 +1,55 @@
+<triple>
+  <boolean>
+    <value>and</value>
+  </boolean>
+  <leftOperand>
+    <triple>
+      <boolean>
+        <value>and</value>
+      </boolean>
+      <leftOperand>
+        <searchClause>
+          <index>cql.serverChoice</index>
+          <relation>
+            <value>=</value>
+          </relation>
+          <term>cat</term>
+        </searchClause>
+      </leftOperand>
+      <rightOperand>
+        <triple>
+          <boolean>
+            <value>or</value>
+          </boolean>
+          <leftOperand>
+            <searchClause>
+              <index>cql.serverChoice</index>
+              <relation>
+                <value>=</value>
+              </relation>
+              <term>horse</term>
+            </searchClause>
+          </leftOperand>
+          <rightOperand>
+            <searchClause>
+              <index>cql.serverChoice</index>
+              <relation>
+                <value>=</value>
+              </relation>
+              <term>frog</term>
+            </searchClause>
+          </rightOperand>
+        </triple>
+      </rightOperand>
+    </triple>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>chips</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/08/.gitignore b/util/regression/sections/08/.gitignore
new file mode 100644 (file)
index 0000000..b03b3d1
--- /dev/null
@@ -0,0 +1,2 @@
+name
+*.cql
diff --git a/util/regression/sections/08/01.xcql b/util/regression/sections/08/01.xcql
new file mode 100644 (file)
index 0000000..4e2d548
--- /dev/null
@@ -0,0 +1,13 @@
+<searchClause>
+  <prefixes>
+    <prefix>
+      <name>foo</name>
+      <identifier>http://www.loc.gov/zing/cql/dc-indexes/</identifier>
+    </prefix>
+  </prefixes>
+  <index>dc.title</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>fish</term>
+</searchClause>
diff --git a/util/regression/sections/08/02.xcql b/util/regression/sections/08/02.xcql
new file mode 100644 (file)
index 0000000..63ce6ad
--- /dev/null
@@ -0,0 +1,12 @@
+<searchClause>
+  <prefixes>
+    <prefix>
+      <identifier>http://www.loc.gov/zing/cql/dc-indexes/</identifier>
+    </prefix>
+  </prefixes>
+  <index>title</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>fish</term>
+</searchClause>
diff --git a/util/regression/sections/08/03.xcql b/util/regression/sections/08/03.xcql
new file mode 100644 (file)
index 0000000..025c7c9
--- /dev/null
@@ -0,0 +1,33 @@
+<triple>
+  <prefixes>
+    <prefix>
+      <name>foo</name>
+      <identifier>http://www.loc.gov/zing/cql/dc-indexes</identifier>
+    </prefix>
+    <prefix>
+      <name>ccg</name>
+      <identifier>http://srw.o-r-g.org/cql/indexSets/ccg/</identifier>
+    </prefix>
+  </prefixes>
+  <boolean>
+    <value>and</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>foo.title</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>fish</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>ccg.force</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>3</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/09/.gitignore b/util/regression/sections/09/.gitignore
new file mode 100644 (file)
index 0000000..b03b3d1
--- /dev/null
@@ -0,0 +1,2 @@
+name
+*.cql
diff --git a/util/regression/sections/09/01.xcql b/util/regression/sections/09/01.xcql
new file mode 100644 (file)
index 0000000..f721ed0
--- /dev/null
@@ -0,0 +1,39 @@
+<triple>
+  <boolean>
+    <value>and</value>
+  </boolean>
+  <leftOperand>
+    <triple>
+      <boolean>
+        <value>or</value>
+      </boolean>
+      <leftOperand>
+        <searchClause>
+          <index>cql.serverChoice</index>
+          <relation>
+            <value>=</value>
+          </relation>
+          <term>any</term>
+        </searchClause>
+      </leftOperand>
+      <rightOperand>
+        <searchClause>
+          <index>cql.serverChoice</index>
+          <relation>
+            <value>=</value>
+          </relation>
+          <term>all:stem</term>
+        </searchClause>
+      </rightOperand>
+    </triple>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>all contains</index>
+      <relation>
+        <value>any</value>
+      </relation>
+      <term>prox proxfuzzy</term>
+    </searchClause>
+  </rightOperand>
+</triple>
diff --git a/util/regression/sections/09/02.xcql b/util/regression/sections/09/02.xcql
new file mode 100644 (file)
index 0000000..dd7c8f0
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>any</term>
+</searchClause>
diff --git a/util/regression/sections/09/03.xcql b/util/regression/sections/09/03.xcql
new file mode 100644 (file)
index 0000000..1eeff16
--- /dev/null
@@ -0,0 +1,7 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term></term>
+</searchClause>
diff --git a/util/regression/sections/09/04.xcql b/util/regression/sections/09/04.xcql
new file mode 100644 (file)
index 0000000..aed8eca
--- /dev/null
@@ -0,0 +1,16 @@
+<searchClause>
+  <prefixes>
+    <prefix>
+      <identifier>any</identifier>
+    </prefix>
+    <prefix>
+      <name>any</name>
+      <identifier>exact</identifier>
+    </prefix>
+  </prefixes>
+  <index>any</index>
+  <relation>
+    <value>&gt;</value>
+  </relation>
+  <term>any</term>
+</searchClause>
diff --git a/util/regression/sections/09/05.xcql b/util/regression/sections/09/05.xcql
new file mode 100644 (file)
index 0000000..578af0f
--- /dev/null
@@ -0,0 +1,12 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>sortby</term>
+  <sortKeys>
+    <key>
+      <index>sortby</index>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/09/06.xcql b/util/regression/sections/09/06.xcql
new file mode 100644 (file)
index 0000000..2e136b5
--- /dev/null
@@ -0,0 +1,18 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>sortby</term>
+  <sortKeys>
+    <key>
+      <index>sortby</index>
+    </key>
+    <key>
+      <index>sortby</index>
+    </key>
+    <key>
+      <index>sortby</index>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/10/.gitignore b/util/regression/sections/10/.gitignore
new file mode 100644 (file)
index 0000000..b03b3d1
--- /dev/null
@@ -0,0 +1,2 @@
+name
+*.cql
diff --git a/util/regression/sections/10/01.xcql b/util/regression/sections/10/01.xcql
new file mode 100644 (file)
index 0000000..0c8cc74
--- /dev/null
@@ -0,0 +1,12 @@
+<searchClause>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>kernighan</term>
+  <sortKeys>
+    <key>
+      <index>title</index>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/10/02.xcql b/util/regression/sections/10/02.xcql
new file mode 100644 (file)
index 0000000..dbd6407
--- /dev/null
@@ -0,0 +1,28 @@
+<triple>
+  <boolean>
+    <value>and</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>kernighan</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>ritchie</term>
+    </searchClause>
+  </rightOperand>
+  <sortKeys>
+    <key>
+      <index>title</index>
+    </key>
+  </sortKeys>
+</triple>
diff --git a/util/regression/sections/10/03.xcql b/util/regression/sections/10/03.xcql
new file mode 100644 (file)
index 0000000..eaef782
--- /dev/null
@@ -0,0 +1,12 @@
+<searchClause>
+  <index>dc.creator</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>kernighan</term>
+  <sortKeys>
+    <key>
+      <index>dc.title</index>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/10/04.xcql b/util/regression/sections/10/04.xcql
new file mode 100644 (file)
index 0000000..3a32884
--- /dev/null
@@ -0,0 +1,17 @@
+<searchClause>
+  <index>dc.creator</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>kernighan</term>
+  <sortKeys>
+    <key>
+      <index>numberOfLegs</index>
+      <modifiers>
+        <modifier>
+          <type>cql.number</type>
+        </modifier>
+      </modifiers>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/10/05.xcql b/util/regression/sections/10/05.xcql
new file mode 100644 (file)
index 0000000..5821b04
--- /dev/null
@@ -0,0 +1,17 @@
+<searchClause>
+  <index>dc.creator</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>kernighan</term>
+  <sortKeys>
+    <key>
+      <index>dc.title</index>
+      <modifiers>
+        <modifier>
+          <type>sort.respectcase</type>
+        </modifier>
+      </modifiers>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/10/06.xcql b/util/regression/sections/10/06.xcql
new file mode 100644 (file)
index 0000000..8d232b2
--- /dev/null
@@ -0,0 +1,20 @@
+<searchClause>
+  <index>dc.creator</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>kernighan</term>
+  <sortKeys>
+    <key>
+      <index>dc.title</index>
+      <modifiers>
+        <modifier>
+          <type>sort.respectcase</type>
+        </modifier>
+        <modifier>
+          <type>sort.descending</type>
+        </modifier>
+      </modifiers>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/10/07.xcql b/util/regression/sections/10/07.xcql
new file mode 100644 (file)
index 0000000..13737ee
--- /dev/null
@@ -0,0 +1,15 @@
+<searchClause>
+  <index>dc.creator</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>kernighan</term>
+  <sortKeys>
+    <key>
+      <index>dc.date</index>
+    </key>
+    <key>
+      <index>dc.title</index>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/10/08.xcql b/util/regression/sections/10/08.xcql
new file mode 100644 (file)
index 0000000..bcf2a8f
--- /dev/null
@@ -0,0 +1,17 @@
+<searchClause>
+  <index>dc.creator</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>kernighan</term>
+  <sortKeys>
+    <key>
+      <index>dc.date</index>
+      <modifiers>
+        <modifier>
+          <type>sort.missingomit</type>
+        </modifier>
+      </modifiers>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/10/09.xcql b/util/regression/sections/10/09.xcql
new file mode 100644 (file)
index 0000000..8a60d51
--- /dev/null
@@ -0,0 +1,19 @@
+<searchClause>
+  <index>dc.creator</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>kernighan</term>
+  <sortKeys>
+    <key>
+      <index>dc.date</index>
+      <modifiers>
+        <modifier>
+          <type>sort.missingvalue</type>
+          <comparison>=</comparison>
+          <value>1970</value>
+        </modifier>
+      </modifiers>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/10/10.xcql b/util/regression/sections/10/10.xcql
new file mode 100644 (file)
index 0000000..cb97df6
--- /dev/null
@@ -0,0 +1,18 @@
+<searchClause>
+  <prefixes>
+    <prefix>
+      <name>dc</name>
+      <identifier>http://deepcustard.org/1.0</identifier>
+    </prefix>
+  </prefixes>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>blah</term>
+  <sortKeys>
+    <key>
+      <index>dc.custardDepth</index>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/10/11.xcql b/util/regression/sections/10/11.xcql
new file mode 100644 (file)
index 0000000..ba2abe7
--- /dev/null
@@ -0,0 +1,38 @@
+<searchClause>
+  <prefixes>
+    <prefix>
+      <name>ns1</name>
+      <identifier>http://uri1</identifier>
+    </prefix>
+    <prefix>
+      <name>ns2</name>
+      <identifier>http://uri2</identifier>
+    </prefix>
+  </prefixes>
+  <index>cql.serverChoice</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>whatever</term>
+  <sortKeys>
+    <key>
+      <index>ns1.key</index>
+      <modifiers>
+        <modifier>
+          <type>a</type>
+        </modifier>
+        <modifier>
+          <type>b</type>
+        </modifier>
+        <modifier>
+          <type>c</type>
+          <comparison>=</comparison>
+          <value>1</value>
+        </modifier>
+      </modifiers>
+    </key>
+    <key>
+      <index>ns2.key2</index>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/10/12.xcql b/util/regression/sections/10/12.xcql
new file mode 100644 (file)
index 0000000..06b0ac2
--- /dev/null
@@ -0,0 +1,18 @@
+<searchClause>
+  <prefixes>
+    <prefix>
+      <name>dc</name>
+      <identifier>x</identifier>
+    </prefix>
+  </prefixes>
+  <index>b</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>c</term>
+  <sortKeys>
+    <key>
+      <index>d</index>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/10/13.xcql b/util/regression/sections/10/13.xcql
new file mode 100644 (file)
index 0000000..06b0ac2
--- /dev/null
@@ -0,0 +1,18 @@
+<searchClause>
+  <prefixes>
+    <prefix>
+      <name>dc</name>
+      <identifier>x</identifier>
+    </prefix>
+  </prefixes>
+  <index>b</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>c</term>
+  <sortKeys>
+    <key>
+      <index>d</index>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/10/14.xcql b/util/regression/sections/10/14.xcql
new file mode 100644 (file)
index 0000000..4f9f6d2
--- /dev/null
@@ -0,0 +1,34 @@
+<triple>
+  <prefixes>
+    <prefix>
+      <name>dc</name>
+      <identifier>x</identifier>
+    </prefix>
+  </prefixes>
+  <boolean>
+    <value>and</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>c1</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>c2</term>
+    </searchClause>
+  </rightOperand>
+  <sortKeys>
+    <key>
+      <index>d</index>
+    </key>
+  </sortKeys>
+</triple>
diff --git a/util/regression/sections/10/15.xcql b/util/regression/sections/10/15.xcql
new file mode 100644 (file)
index 0000000..fb278bc
--- /dev/null
@@ -0,0 +1,22 @@
+<searchClause>
+  <prefixes>
+    <prefix>
+      <name>dc</name>
+      <identifier>http://deepcustard.org</identifier>
+    </prefix>
+    <prefix>
+      <name>dc</name>
+      <identifier>http://dublincore.org</identifier>
+    </prefix>
+  </prefixes>
+  <index>dc.title</index>
+  <relation>
+    <value>=</value>
+  </relation>
+  <term>jaws</term>
+  <sortKeys>
+    <key>
+      <index>dc.custardDepth</index>
+    </key>
+  </sortKeys>
+</searchClause>
diff --git a/util/regression/sections/10/16.xcql b/util/regression/sections/10/16.xcql
new file mode 100644 (file)
index 0000000..42b01d6
--- /dev/null
@@ -0,0 +1,40 @@
+<triple>
+  <prefixes>
+    <prefix>
+      <name>dc</name>
+      <identifier>http://deepcustard.org</identifier>
+    </prefix>
+  </prefixes>
+  <boolean>
+    <value>or</value>
+  </boolean>
+  <leftOperand>
+    <searchClause>
+      <index>cql.serverChoice</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>fish</term>
+    </searchClause>
+  </leftOperand>
+  <rightOperand>
+    <searchClause>
+      <prefixes>
+        <prefix>
+          <name>dc</name>
+          <identifier>http://dublincore.org</identifier>
+        </prefix>
+      </prefixes>
+      <index>dc.title</index>
+      <relation>
+        <value>=</value>
+      </relation>
+      <term>jaws</term>
+    </searchClause>
+  </rightOperand>
+  <sortKeys>
+    <key>
+      <index>dc.custardDepth</index>
+    </key>
+  </sortKeys>
+</triple>
diff --git a/util/regression/showtest b/util/regression/showtest
new file mode 100755 (executable)
index 0000000..0154d9d
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+
+if [ $# != 1 ]; then
+       echo "Usage: $0 <test-name>" >&2
+       echo "  e.g. $0 01/02" >&2
+       exit 1
+fi
+
+### Warning: nasty hard-coded choices
+( echo "=== Adam ==="
+  ../../../srw/cql/cql2xcql < sections/$1.cql ) > /tmp/adam
+( echo "=== Mike ==="
+  ../../bin/CQLParser < sections/$1.cql ) > /tmp/mike
+sdiff -w 80 /tmp/adam /tmp/mike
diff --git a/util/regression/xmlpp.pl b/util/regression/xmlpp.pl
new file mode 100755 (executable)
index 0000000..9e8abef
--- /dev/null
@@ -0,0 +1,405 @@
+#!/usr/bin/perl  -w
+
+#
+#  Copyright (c) 2002, DecisionSoft Limited All rights reserved.
+#  Please see: 
+#  http://software.decisionsoft.com/license.html
+#  for more information.
+# 
+
+# $Revision: 1.2 $
+#
+# xmlpp: XML pretty printing
+#
+
+# For custom attribute sorting create an attributeOrdering.txt file that
+# lists each attributes separated by a newline in the order you would like
+# them to be sorted separated by a newline. Then use the -s option.
+
+use FileHandle;
+use Fcntl;
+use Getopt::Std;
+
+use vars qw($opt_h $opt_H $opt_s $opt_z $opt_t $opt_e $opt_S $opt_c $opt_n $opt_l);
+
+my $indent=0;
+my $textContent='';
+my $lastTag=undef;
+my $output;
+my $inAnnotation = 0;
+
+
+if (!getopts('nzhHsteScl:') or $opt_h) {
+    usage();
+}
+
+my $indentSize = $opt_l || 2;
+
+if ($opt_s){
+
+# expect to find attributeOrdering.txt file in same directory
+# as xmlpp is being run from
+    
+  my $scriptDir = $0;
+  if ($scriptDir =~ m#/#){
+    $scriptDir =~ s#/[^/]+$##;
+  }
+  else{
+    $scriptDir =".";
+  }
+    
+  # get attribute ordering from external file
+  if (open(SORTLIST, "<$scriptDir/attributeOrdering.txt")) {
+    @sortlist = <SORTLIST>;
+    chomp @sortlist;
+    close (SORTLIST);
+    @specialSort = grep(/^\w+/, @sortlist);
+  } 
+  else {      
+   print STDERR  "Could not open $scriptDir/attributeOrdering.txt: $!\nWARNING attribute sorting will only be alphabetic\n\n";
+  }
+}
+
+
+# set line separator to ">" speeding up parsing of XML files
+# with no line breaks 
+
+$/ = ">";
+
+
+my $sortAttributes = $opt_s;
+my $newLineComments = $opt_c;
+my $splitAttributes = $opt_t;
+my $schemaHackMode = $opt_S;
+my $normaliseWhiteSpace = $opt_n;
+
+my $filename = $ARGV[0];
+if ($opt_z && (!$filename or $filename eq '-')) {
+    print STDERR "Error: I can't edit STDIN in place.\n";
+    usage();
+}
+
+if (!$opt_z && scalar(@ARGV) > 1) {
+    print STDERR "Warning: Multiple files specified without -z option\n"; 
+}
+
+my $fh;
+
+my $stdin;
+
+if (!$filename or $filename eq '-') {
+    $fh=*STDIN;
+    $stdin=1;
+} else {
+    $fh = open_next_file() or exit(1);
+    $stdin=0;
+}
+
+do {
+    $indent=0;
+    $textContent='';
+    $lastTag=undef;
+    $output = '';
+    my $re_name = "(?:[A-Za-z0-9_:][A-Za-z0-9_:.-]*)";
+    my $re_attr = "(?:'[^']*'|\"[^\"]*\")";
+    my $input;
+
+    while ($input .= <$fh>) {
+        while ($input) {
+            if ($input =~ s/^<($re_name)((?:\s+$re_name\s*=\s*$re_attr)*\s*)(\/?)>(.*)$/$4/s ) {
+                my %attr;
+                my ($name,$attr,$selfclose) = ($1,$2,$3);
+                while ($attr =~ m/($re_name)\s*=\s*($re_attr)/gs) {
+                    my ($name,$value) = ($1,$2);
+                    $value =~ s/^["'](.*)["']$/$1/s;
+                    $attr{$name} = $value;
+                }
+                if ($opt_e) {
+                    parseStart($name, 0, %attr);
+                    if ($selfclose) { parseEnd($name) }
+                } else {
+                    parseStart($name, $selfclose, %attr);
+                }
+            } elsif ($input =~ s/^<\/($re_name)\s*>(.*)$/$2/s) {
+                parseEnd($1);
+            } elsif ($input =~ s/^<!--(.*?)-->(.*)$/$2/s) { 
+                parseComment($1);
+            } elsif ($input =~ s/^([^<]+)(.*)$/$2/s) {
+                parseDefault($1);
+            } elsif ($input =~ s/^(<\?[^>]*\?>)(.*)$/$2/s) {
+                parsePI("$1\n");
+            } elsif ($input =~ s/^(<\!DOCTYPE[^\[>]*(\[[^\]]*\])?[^>]*>)(.*)$/$3/s) {
+                parseDoctype("$1");
+            } else {
+                last;
+            }
+        }
+        if (eof($fh)) {
+            last;
+        }
+    }
+
+
+    if ($input) {
+        $input =~ m/([^\n]+)/gs;
+        print STDERR "WARNING: junk remaining on input: $1\n";
+    }
+    $fh->close();
+
+    if (!$opt_z) {
+        if(!$opt_H){ 
+            print "$output\n"
+        } else {
+            print html_escape($output)."\n"
+        }
+    } else {
+        if ($input) { 
+            print STDERR "Not overwriting file\n";
+        } else {
+            open FOUT,"> $filename" or die "Cannot overwrite file: $!";
+            if(!$opt_H){
+                print FOUT "$output\n"
+            } else {
+                print FOUT html_escape($output)."\n"
+            }
+            close FOUT
+        }
+    }
+} while (
+    !$stdin && $opt_z && ($fh = open_next_file(\$filename))
+  );
+  
+
+
+sub parseStart {
+    my $s = shift;
+    my $selfclose = shift;
+    my %attr = @_;
+
+    $textContent =~ s/\s+$//; 
+    printContent($textContent);
+
+    if($inAnnotation) {
+        return;
+    }
+
+    if($schemaHackMode and $s =~ m/(^|:)annotation$/) {
+        $inAnnotation = 1;
+        $textContent = '';
+        $lastTag = 1;
+        return;
+    }
+    if (length($output)) {
+        $output .= "\n";
+    }
+
+    $output .= " " x ($indent * $indentSize);
+    $output .= "<$s";
+    my @k = keys %attr;
+
+    if ($sortAttributes && (scalar(@k) > 1) ){
+
+      my @alphaSorted;
+      my @needSpecialSort;
+      my @final;
+      my $isSpecial;
+
+      # sort attributes alphabetically (default ordering)
+      @alphaSorted = sort @k;
+
+      # read through sorted list, if attribute doesn't have specified
+      # sort order, push it onto the end of the final array (this maintains
+      # alphabetic order). Else create a list that has attributes needing
+      # special ordering.
+      foreach $attribute (@alphaSorted){
+        $isSpecial = 0;
+        foreach $sortAttrib (@specialSort){
+          if ($attribute eq $sortAttrib){
+            push @needSpecialSort, $attribute;
+            $isSpecial = 1;
+          }
+        }
+        if (!$isSpecial){
+          push @final, $attribute;
+        }
+      }
+
+      # now read through the specialSort list backwards looking for
+      # any match in the needSpecialSort list. Unshift this onto the 
+      # front of the final array to maintain proper order.
+      foreach my $attribute (reverse @specialSort){
+        foreach (@needSpecialSort){
+          if ($attribute eq $_){
+            unshift @final, $attribute;
+          }
+        }
+      }
+
+      @k = @final;
+    }
+
+    foreach my $attr (@k) {
+        # 
+        # Remove (min|max)Occurs = 1 if schemaHackMode
+        #
+        if ($schemaHackMode and $attr =~ m/^(minOccurs|maxOccurs)$/ and $attr{$attr} eq "1") {
+            next;
+        }
+
+        if ($splitAttributes) {
+            $output .= "\n"." " x ($indent * $indentSize) ." ";
+        }
+        if ($attr{$attr} =~ /'/) {
+            $output .= " $attr=\"$attr{$attr}\"";
+        } else {
+            $output .= " $attr='$attr{$attr}'";
+        }
+    }
+    if ($splitAttributes and @k) {
+        $output .= "\n"." " x ($indent * $indentSize);
+    }
+    if ($selfclose) {
+        $output .= " />";
+        $lastTag = 0;
+    } else {
+        $output .= ">";
+        $indent++;
+        $lastTag = 1;
+    }
+    $textContent = '';
+}
+
+sub parseEnd {
+    my $s = shift;
+
+    if($inAnnotation) {
+        if($s =~ m/(^|:)annotation$/) {
+            $inAnnotation = 0;
+        }
+        return;
+    }
+
+    if($normaliseWhiteSpace) {
+        $textContent =~ s/^\s*(.*?)\s*$/$1/;
+    }
+    $indent--;
+    printContent($textContent);
+    if ($lastTag == 0) {
+        $output .= "\n";
+        $output .= " " x ($indent * $indentSize);
+    } 
+    $output .= "</$s>";
+    $textContent = '';
+    $lastTag = 0;
+}
+
+sub parseDefault {
+    my $s = shift;
+    if($inAnnotation) { return }
+    $textContent .= "$s";
+}
+
+sub parsePI {
+    my $s = shift;
+    $output .= "$s";
+}
+
+sub parseDoctype {
+    my $s = shift;
+    if ($s =~ /^([^\[]*\[)([^\]]*)(\].*)$/ms) {
+      $start = $1;
+      $DTD = $2;
+      $finish = $3;
+      $DTD =~ s/\</\n  \</msg;
+      $output .= "$start$DTD\n$finish\n";
+    } else {
+      $output .= "$s";
+    }
+}
+
+sub parseComment {
+    my $s = shift; 
+    if($inAnnotation) { return }
+    printContent($textContent,1);
+    if ($s =~ /([^\<]*)(<.*>)(.*)/ms) {
+      $start = $1;
+      $xml = $2;
+      $finish = $3;
+      $xml =~ s/\</\n\</msg;
+      $xml =~ s/(\n\s*\n?)+/\n/msg;
+      $xml =~ s/^\s*//msg;
+      $xml =~ s/\s*$//msg;
+      $s = "$start\n$xml\n$finish";
+    }
+    $s =~ s/\n\s*$/\n  /msg;
+    if ($newLineComments) {
+        $output .= "\n<!--$s-->\n";
+    } else {
+        $output .= "<!--$s-->";
+    }
+    $textContent='';
+}
+
+sub printContent {
+    my $s = shift;
+    my $printLF = shift;
+    my ($LF,$ret) = ("","");
+
+    if ($s =~ m/\n\s*$/) {
+        $LF = "\n"; 
+    }
+    if ($s =~ m/^[\s\n]*$/) {
+        $ret = undef;
+    } else {
+        $output .= "$s";
+        $ret = 1;
+    }
+    if ($printLF) {
+        $output .= $LF;
+    }
+}
+
+
+sub html_escape {
+    my $s = shift;
+    $s =~ s/&/&amp;/gsm;
+    $s =~ s/</&lt;/gsm;
+     $s =~ s/>/&gt;/gsm;
+    return $s;
+}
+
+sub open_next_file {
+    my $filename = shift;
+    $$filename = shift @ARGV;
+    while ($$filename and ! -f $$filename) {
+        print STDERR "WARNING: Could not find file: $$filename\n";
+        $$filename = shift @ARGV;
+    }
+    if(!$$filename) {
+        return undef;
+    }
+    my $fh = new FileHandle;
+    $fh->open("< $$filename") or die "Can't open $$filename: $!";
+    return $fh;
+}
+
+sub usage {
+    print STDERR <<EOF;
+usage: $0 [ options ] [ file.xml ... ]
+
+options:
+  -h  display this help message
+  -H  escape characters (useful for further processing)
+  -t  split attributes, one per line (useful for diff)
+  -s  sort attributes (useful for diff)
+  -z  in place edit (zap)
+  -e  expand self closing tags (useful for diff)
+  -S  schema hack mode (used by xmldiff)
+  -c  place comments on new line.
+  -n  normalise whitespace (remove leading and trailing whitespace from nodes
+      with text content.
+  -l <num>  Indent each level by <num> spaces [default: 2]
+EOF
+    exit 1;
+}
+