help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SQL grammar


From: Evan Lavelle
Subject: Re: SQL grammar
Date: Mon, 12 May 2008 09:29:20 +0100
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

Evan Lavelle wrote:
Check the logs, as Hans suggests. For starters, though, what's this:

NOT IN ((SELECT '*' FROM SCONST))

What sort of 'search_cond' is it? First branch, second branch, or both? It can't be both; that's a conflict.

Sorry, didn't read your first post; seems you already knew this.

There's no general fix. You need a detailed understanding of your language, and you have to formulate the grammar in a way that doesn't have these overlaps. There are a lot of SQL parsers on the net, so that would be a good place to start.

In this simple case, your problem is that a query_specification can be both a query and an expression. This might make sense to a human, but not to a parser. You appear to be trying to fix this by the use of brackets, but this won't work, since a bracketed expression is still an expression. There are various things you can try, but which one you should use depends on the language itself, which I know nothing about:

1 - completely subsume queries into expressions

2 - completely exclude queries from expressions

3 - allow both query_lists and expressions to include query_specifications, but make sure that you never write a production that actually uses both a query_list and an expression

Evan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]