docs: function(i, query) {
        if(query.charAt(i) == this.ATOM_FILTER_QUERY_START) {
          var j=i+1;
          var scopeDepth=1;
          var queryToken="";
          var strReadAheadResult;
          while(scopeDepth>0) {
            var ch=query.charAt(j); var strReadResult;
            if(ch == this.ATOM_FILTER_QUERY_START) {
              scopeDepth++; queryToken += ch; j++;
            }
            else if(ch == this.ATOM_FILTER_QUERY_END) {
              scopeDepth--; j++;
              if(scopeDepth == 0) break;
              queryToken += ch;
            }
            else if(strReadAheadResult = SpahQL.Token.String.parseAt(j, query)) {
              queryToken += query.substring(j,strReadAheadResult[0]); j = strReadAheadResult[0];
            }
            else {
              queryToken += ch; j++;
            }         
          }
          if(queryToken.length > 0) { // query token does not include final closing bracket
            return [j, new this(SpahQL.QueryParser.parseQuery(queryToken))];
          }
          else {
            this.throwParseErrorAt(j, query, "Found unexpected ATOM_FILTER_QUERY_END, expected TOKEN_SELECTION_QUERY or TOKEN_ASSERTION_QUERY. Looked like those brackets were empty - make sure they have a query in them.");
          }
        }
        return null;
      }