Sergei Golubchik wrote:
> Hi!
>
> On Dec 10, Davi Arnaut wrote:
>> ChangeSet@stripped, 2007-12-10 11:34:12-02:00, davi@stripped +7 -0
>> Bug#28317 Left Outer Join with {oj outer-join}
>>
>> Parser rejects ODBC's escape sequences for outer joins other than
>> left outer join, yet the escape sequence BNF specifies that this
>> syntax can be used for left, right, and full outer join syntax.
>
> Why not to do it in the parser ? Lexer's task, conceptually, is to split
> the input stream of characters into a stream of lexems. And parser is
> supposed to apply grammar rules to the that.
Practically speaking, because it introduces complexity and conflicts to
the parser for something that in the first place shouldn't be handled by
the server parser.
Conceptually speaking, a Lexer task is to do lexical analysis which is a
"tokenization" process, but it doesn't me it must convert all characters
into tokens. If the "lexeme" doesn't have any meaning, there is no point
in passing it to the parser. This is quite common, you don't see parsers
taking whitespace and comments into account.
Regards,
--
Davi Arnaut, Software Engineer
MySQL Inc, www.mysql.com
Are you MySQL certified? www.mysql.com/certification