OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

search-ws message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: CQL Parsing Questions


Hi:

I have two CQL questions which may be parser issues rather than CQL spec
issues per se. (I am using Mike Taylor's Java parser.)


1. Unrecognized booleans

I can't seem to get an error from the parser on unrecognized booleans (here
'but'):

% cql 'foo=1 but bar=2'
<searchClause>
  <index>bar</index>
  <relation>
    <value>=</value>
  </relation>
  <term>2</term>
</searchClause>

I asked Mike about this and he said:

    "It interacts badly with another, better rule, which says that
index-relation pairs nested within a clause override those outside the
clause -- so that
        title=(author=kernighan)
is equivalent to
        author=kernighan
"

and following up with him he claimed this was cooked into the BNF although I
don't pretend to understand the original BNF (my head hurts with all the
recursion).

The parser can be coaxed though to give an error by grouping as:

% cql '(foo=1) but (bar=2)'
Syntax error: expected boolean, got word: but

(For reference a recognized boolean, 'and' say, is parsed as given below at
end of message.) 


2. Legal term characters

From the production rule for simple strings I am assuming that a term such
as '2009-09-09' should be valid (without quotes), and yet the parser
complains as:

% cql 'x=2009-09-09'
Syntax error: expected boolean, got -9

Is that incorrect behaviour?

Quoting the term of course produces a valid parse:

% cql 'x="2009-09-09"'
<searchClause>
  <index>x</index>
  <relation>
    <value>=</value>
  </relation>
  <term>2009-09-09</term>
</searchClause>


I wasn't sure where to send these questions. Like I said I did ask Mike
about the first.

Cheers,

Tony


* Recognized boolean (for reference)

% cql 'foo=1 and bar=2'
<triple>
  <boolean>
    <value>and</value>
  </boolean>
  <leftOperand>
    <searchClause>
      <index>foo</index>
      <relation>
        <value>=</value>
      </relation>
      <term>1</term>
    </searchClause>
  </leftOperand>
  <rightOperand>
    <searchClause>
      <index>bar</index>
      <relation>
        <value>=</value>
      </relation>
      <term>2</term>
    </searchClause>
  </rightOperand>
</triple>



********************************************************************************   
DISCLAIMER: This e-mail is confidential and should not be used by anyone who is
not the original intended recipient. If you have received this e-mail in error
please inform the sender and delete it from your mailbox or any other storage
mechanism. Neither Macmillan Publishers Limited nor any of its agents accept
liability for any statements made which are clearly the sender's own and not
expressly made on behalf of Macmillan Publishers Limited or one of its agents.
Please note that neither Macmillan Publishers Limited nor any of its agents
accept any responsibility for viruses that may be contained in this e-mail or
its attachments and it is your responsibility to scan the e-mail and 
attachments (if any). No contracts may be concluded on behalf of Macmillan 
Publishers Limited or its agents by means of e-mail communication. Macmillan 
Publishers Limited Registered in England and Wales with registered number 785998 
Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS   
********************************************************************************



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]