On Fri, Sep 3, 2010 at 8:51 AM, Mike Taylor <[log in to unmask]> wrote:
> On 3 September 2010 13:44, Tim Williams <[log in to unmask]> wrote:
>> On Thu, Sep 2, 2010 at 4:18 PM, Mike Taylor <[log in to unmask]> wrote:
>>> On 2 September 2010 18:12, Tim Williams <[log in to unmask]> wrote:
>>>> I have this need to support complex boolean queries within a field.
>>>> I'd like to not have to repeat the 'index relation' over and over
>>>> within the statement.  Rather, I'd like something like
>>>>   title = ((fish OR turtle) AND sea) - though, much more complex -
>>>> and don't want to have to write:
>>>>  ((title = fish OR title = turtle) AND title = sea)
>>>> Logically, it's just projecting the index and relation upon the
>>>> enclosed terms.  Before we depart from the CQL spec I thought I'd see
>>>> if there was a way to get similar 'shortcutting' using build-in
>>>> extension mechanisms?
>>> Although the formal specification of CQL stupidly prohibits this
>>> useful and unambiguous syntax, most or maybe all actual
>>> implementations support it -- certainly the C/C++ parser in YAZ,
>>> CQL-Java, the Perl CQL::Parser and thr Ruby gem all do.  Have you
>>> tried just going ahead and doing it?  If it's being rejected, what CQL
>>> parser are you using?
>> Thanks Mike, I've got a little ANTLR grammar internally that
>> implements a version of CQL.  This lack of index+relation projection
>> is one of two areas that I've had to stray from the spec so far... the
>> other is the limited support for proximity.
> If you're using ANTLR, does that mean you're in Java?  If so, why not
> just use CQL-Java instead of rolling your own?

Yeah, I'm on the JVM.  It's complicated and only somewhat reasonable I
suppose but...

o) I wanted freedom to easily break from the spec - I knew of the prox
problem early on and figured others would come up.
o) I need to do numerous translations to implementation
grammars/objects - easily done with ANTLR Tree Grammars.
o) It was easier than learning your api (documentation left me wanting) :(

As I said, it's only somewhat reasonable:)  It made sense at the time anyway.