Responses below....

> -----Original Message-----
> From: Gavin King [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 17, 2003 6:50 AM
> > -- Grammar problem #1: The 'from Order order where' examples --
> > 
> > Also, notice that I changed 'order' to 'ord' in many of the HQL 
> > examples in the hibernate documentation.  This is because 
> 'order' is a 
> > keyword.
> Don't worry. Just outlaw keywords as identifiers. The reality 
> is that if 
> we do this, we will need to be supporting two query engines 
> in parallel 
> for quite some time. I have already accepted this. Its the 
> price we pay 
> for not having had time to do this rewrite earlier.

Well, I've already built in 'keyword as identifier' support, but the problem
I was having is the precedence of the keyword as identifier trick.  In this
case 'order' is an acceptable token, and is not follwed by 'by', nor is it
preceded by the optional 'as' token which would make 'order' an alias.
Actually, the real trick would be to support multi-word keywords, like
'order by'.  I'm spending a little time on that, but I'd rather get the
grammar down 'clean' before getting caught up in all the kinks of this
particular example.

> > -- Grammar problem #2: The 'current date' problem --
> This is DB2. "current date" is a function, I guess. Isn't it 
> possible to 
> just "pass through" any tokens that the parser doesn't recognize as 
> "something else"? If not, there might be other ways to handle this.

Yes and no.  The grammar would have to allow for:
        expression : identifier identifier

This would not fit into the expression part of the grammar very well, and
places more workload on subsequent analysis phases.  I guess the main
question to ask is: How would the parser know when to pass through?




-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to