[antlr-interest] Q: move from v2 to v3 parser grammar. Rewrite tree rule
Ruslan Zasukhin
ruslan_zasukhin at valentina-db.com
Tue Mar 22 14:20:33 PDT 2011
On 3/22/11 8:59 PM, "Jim Idle" <jimi at temporal-wave.com> wrote:
Hi Jim,
Thank you for answer.
> That is telling you that err, you can't use rewrite syntax AND an operator
> ;). Which one is it supposed to use?
>
> So, remove any ^ and ! operators from the rule and use rewrite rules only.
Yes, this is clear now :)
> However, is that what you want to rewrite it as. I think you are using
> query_expression as that was what it looked like in v2. You might be
> better off abstracting in to two rules:
>
> queryExpression
> : unionExpressions -> ^(QUERY_EXPRESSION unionExpressions) ;
>
> unionExpressions
> : query_term (( "union"^ | "except"^ ) "all"? query_term)* ;
So really 2 rules should be used as was in my first letter.
Okay, then we will make such changes in our grammar from v2
> However, using lower case literals in your parser directly is not a good
> idea. Use real tokens so that you error messages are better
Simple example, please?
> and remember
> that SQL is generally case insensitive so you will need a [trivial] custom
> input stream.
Of course we do remember this :)
And after grammar start to breath, we will yet work on
* case-insensitive of SQL text
* UTF-16 for input -- clarify ..
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
More information about the antlr-interest
mailing list