> -----Original Message-----
> From: Jeremy Cole [mailto:[EMAIL PROTECTED] 
> Sent: den 4 februari 2005 22:24
> To: Thomas Sundberg
> Cc: mysql@lists.mysql.com
> Subject: Re: Syntax diagram, where is it located in the doc?
> 
> Hi Thomas,
> 
> > I'm looking for the syntax diagram for MySQL and can't find 
> it. I have
> 
> Just to give you a complete answer to your question, this is 
> what is valid (I've stripped out the C code parts to leave 
> just the definition):

This was exactly the stuff I have been looking for. This is what I would
expect to be available in the documentation, perhaps in an appendix. There
is of course a definition defined somewhere, but to be forced to read the c
code to find it is a bit more then you would expect from users that just
need a database engine and don't care if they are using Interbase or MySQL.
If the definition where written in an external file using bnf, then this bnf
definition could be used by the sql parser as well as included in the
documentation and nobody would have to maintain two definitions for the same
thing. Anybody able to read bnf could see exactly what the database is
supposed to be capable of.

/Thomas




> 
> where_clause:
>          /* empty */
>          | WHERE expr
> 
> 
> expr:   expr_expr
>          | simple_expr
> 
> expr_expr:
>          expr IN_SYM '(' expr_list ')'
>          | expr NOT IN_SYM '(' expr_list ')'
>          | expr BETWEEN_SYM no_and_expr AND expr
>          | expr NOT BETWEEN_SYM no_and_expr AND expr
>          | expr OR_OR_CONCAT expr
>          | expr OR expr
>          | expr XOR expr
>          | expr AND expr
>          | expr LIKE simple_expr opt_escape
>          | expr NOT LIKE simple_expr opt_escape
>          | expr REGEXP expr
>          | expr NOT REGEXP expr
>          | expr IS NULL_SYM
>          | expr IS NOT NULL_SYM
>          | expr EQ expr
>          | expr EQUAL_SYM expr
>          | expr GE expr
>          | expr GT_SYM expr
>          | expr LE expr
>          | expr LT expr
>          | expr NE expr
>          | expr SHIFT_LEFT expr
>          | expr SHIFT_RIGHT expr
>          | expr '+' expr
>          | expr '-' expr
>          | expr '*' expr
>          | expr '/' expr
>          | expr '|' expr
>          | expr '^' expr
>          | expr '&' expr
>          | expr '%' expr
>          | expr '+' INTERVAL_SYM expr interval
>          | expr '-' INTERVAL_SYM expr interval
> 
> simple_expr:
>          simple_ident
>          | literal
>          | '@' ident_or_text SET_VAR expr
>          | '@' ident_or_text
>          | '@' '@' opt_var_ident_type ident_or_text
>          | sum_expr
>          | '-' expr %prec NEG
>          | '~' expr %prec NEG
>          | NOT expr %prec NEG
>          | '!' expr %prec NEG
>          | '(' expr ')'
>          | '{' ident expr '}'
>          | MATCH ident_list_arg AGAINST '(' expr ')'
>          | MATCH ident_list_arg AGAINST '(' expr IN_SYM 
> BOOLEAN_SYM MODE_SYM ')'
>          | BINARY expr %prec NEG
> 
> Maybe this is more along the lines of what you're looking for...
> 
> <snip all of the random functions>
> 
> Regards,
> 
> Jeremy
> 
> --
> Jeremy Cole
> Technical Yahoo - MySQL (Database) Geek


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to