RE: [Hibernate] introductions of new keywords to ql (Welcome to parser land!)

2004-12-19 Thread Alexey Loubyansky
age- > From: Joshua Davis [mailto:[EMAIL PROTECTED] > Sent: Sunday, December 19, 2004 3:39 AM > To: Joshua Davis > Cc: Alexey Loubyansky; Hibernate development > Subject: Re: [Hibernate] introductions of new keywords to ql > (Welcome to parser land!) > > Okay, that worked so I

Re: [Hibernate] introductions of new keywords to ql (Welcome to parser land!)

2004-12-19 Thread Gavin King
Oh, don't get me wrong, it's a crappy syntax. But that's what the EJB 2.1 spec says Joshua Davis wrote: Gavin King wrote: This EJBQL2 query: FROM Foo foo, IN(foo.bars) bar Is exactly equivalent to this HQL/EJBQL3 query: FROM Foo foo JOIN foo.bars bar Yes, so I gathered from the grammar.

Re: [Hibernate] introductions of new keywords to ql (Welcome to parser land!)

2004-12-19 Thread Joshua Davis
Gavin King wrote: This EJBQL2 query: FROM Foo foo, IN(foo.bars) bar Is exactly equivalent to this HQL/EJBQL3 query: FROM Foo foo JOIN foo.bars bar Yes, so I gathered from the grammar. It's no big deal, but the following would be slightly 'nicer' IMHO: FROM Foo foo IN (foo.bars) bar The us

Re: [Hibernate] introductions of new keywords to ql (Welcome to parser land!)

2004-12-19 Thread Gavin King
This EJBQL2 query: FROM Foo foo, IN(foo.bars) bar Is exactly equivalent to this HQL/EJBQL3 query: FROM Foo foo JOIN foo.bars bar Joshua Davis wrote: Okay, that worked so I'm committing it. The new rule seems a little strange to me, but perhaps I don't understand what it's supposed to do.

Re: [Hibernate] introductions of new keywords to ql (Welcome to parser land!)

2004-12-18 Thread Joshua Davis
Okay, that worked so I'm committing it. The new rule seems a little strange to me, but perhaps I don't understand what it's supposed to do. fromClause : FROM fromClass ( ( COMMA (fromClass | collectionValuedPathDeclaration) ) | (joinType) )* So..."FROM foo f, bar b, IN (red.blue.green) q"

Re: [Hibernate] introductions of new keywords to ql (Welcome to parser land!)

2004-12-18 Thread Joshua Davis
I'm taking a look at it now. The weakKeyword() setting may be able to do this, but I'm not sure how much lookahead is being used after the comma. Alexey Loubyansky wrote: Hi Joshua, I committed another hack in this area. Could you please look at it? The problem is when I add an alternative to fr

RE: [Hibernate] introductions of new keywords to ql (Welcome to parser land!)

2004-12-17 Thread Alexey Loubyansky
Hi Joshua, I committed another hack in this area. Could you please look at it? The problem is when I add an alternative to fromClass (in my case it's a collection valued path declaration, i.e. 'IN(path) id') and in a query after the first fromClass and comma there is another fromClass with class

RE: [Hibernate] introductions of new keywords to ql

2004-12-16 Thread Alexey Loubyansky
PROTECTED] > Subject: Re: [Hibernate] introductions of new keywords to ql > > Actually, the HQL parser is capable of using keywords as > identifiers in > some contexts. I'm not sure what you're saying here, have > you modified > the grammar and this caused HqlParser

RE: [Hibernate] introductions of new keywords to ql

2004-12-16 Thread Joshua Davis
t; > Thanks. > > > -Original Message- > > From: Joshua Davis [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, December 15, 2004 2:13 PM > > To: Alexey Loubyansky > > Cc: [EMAIL PROTECTED] > > Subject: Re: [Hibernate] introductions of new > keyword

Re: [Hibernate] introductions of new keywords to ql

2004-12-16 Thread Joshua Davis
Actually, the HQL parser is capable of using keywords as identifiers in some contexts. I'm not sure what you're saying here, have you modified the grammar and this caused HqlParserTest to fail? If that is the case then there may be something wrong with the modified grammar that is preventin

RE: [Hibernate] introductions of new keywords to ql

2004-12-16 Thread Alexey Loubyansky
ember 15, 2004 4:02 PM > To: Alexey Loubyansky > Cc: [EMAIL PROTECTED] > Subject: RE: [Hibernate] introductions of new keywords to ql > > Aha... So you've introduced a new keyword, and also a new > clause in the the select expression with the new keyword > being the tok

Re: [Hibernate] introductions of new keywords to ql (Welcome to parser land!)

2004-12-16 Thread Joshua Davis
Max Rydahl Andersen wrote: Now when we are adding EJBQL support is there a "easy" (read not to hacky) way of e.g. letting the parser complain if a user is actually using HQL only syntax ? Here are some ways to do this: 1) Add some state to the grammar (it already knows about filter vs. non-fil

Re: [Hibernate] introductions of new keywords to ql (Welcome to parser land!)

2004-12-15 Thread Max Rydahl Andersen
o:[EMAIL PROTECTED] Sent: Wednesday, December 15, 2004 4:02 PM To: Alexey Loubyansky Cc: [EMAIL PROTECTED] Subject: RE: [Hibernate] introductions of new keywords to ql Aha... So you've introduced a new keyword, and also a new clause in the the select expression with the new keyword be

RE: [Hibernate] introductions of new keywords to ql

2004-12-15 Thread Joshua Davis
---Original Message- > > From: Joshua Davis [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, December 15, 2004 4:02 PM > > To: Alexey Loubyansky > > Cc: [EMAIL PROTECTED] > > Subject: RE: [Hibernate] introductions of new > keywords to ql > > > > Aha..