Finish (more or less) to CQL-to-PQF translator.
[cql-java-moved-to-github.git] / src / org / z3950 / zing / cql / CQLNode.java
index 24a2d27..eab6db4 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: CQLNode.java,v 1.11 2002-11-06 00:05:58 mike Exp $
+// $Id: CQLNode.java,v 1.12 2002-11-06 20:13:45 mike Exp $
 
 package org.z3950.zing.cql;
 import java.util.Properties;
@@ -7,7 +7,7 @@ import java.util.Properties;
 /**
  * Represents a node in a CQL parse-tree.
  *
- * @version    $Id: CQLNode.java,v 1.11 2002-11-06 00:05:58 mike Exp $
+ * @version    $Id: CQLNode.java,v 1.12 2002-11-06 20:13:45 mike Exp $
  */
 public abstract class CQLNode {
     CQLNode() {}               // prevent javadoc from documenting this
@@ -39,13 +39,32 @@ public abstract class CQLNode {
     /**
      * Renders a parse-tree into a Yaz-style PQF string.
      * <P>
+     * <PRE>
+       query ::= top-set query-struct.
+       top-set ::= [ '@attrset' string ]
+       query-struct ::= attr-spec | simple | complex | '@term' term-type
+       attr-spec ::= '@attr' [ string ] string query-struct
+       complex ::= operator query-struct query-struct.
+       operator ::= '@and' | '@or' | '@not' | '@prox' proximity.
+       simple ::= result-set | term.
+       result-set ::= '@set' string.
+       term ::= string.
+       proximity ::= exclusion distance ordered relation which-code unit-code.
+       exclusion ::= '1' | '0' | 'void'.
+       distance ::= integer.
+       ordered ::= '1' | '0'.
+       relation ::= integer.
+       which-code ::= 'known' | 'private' | integer.
+       unit-code ::= integer.
+       term-type ::= 'general' | 'numeric' | 'string' | 'oid' | 'datetime' | 'null'.
+     * </PRE>
      * @return
      * A String containing a PQF query equivalent to the parse-tree
      * whose root is this node.  This may be fed into the tool of
      * your choice to obtain a BER-encoded packet.
      */
     abstract public String toPQF(Properties config)
-       throws UnknownQualifierException, UnknownRelationException;
+       throws PQFTranslationException;
 
     /**
      * Returns a String of spaces for indenting to the specified level.