On 11/17/2010 06:33 AM, tc yang wrote:
> 在 2010年11月17日 上午11:22，tc yang<yangtc.sub@stripped>写道：
>> I recently study mysql source code, grammatical and semantic
> analysis，mysql source version 5.57
>> but I can't find .l file for lex and .y for yacc in mysql level，innbase
> dictonary have /pars0lex.l, why mysql don't have lex source?
>> in sql directory only have sql_lex.cc,this is generated from lex source ?
> and where is the lex source(".l" file), and how is generated?
mysql does not use lex/flex for tokenizing, it uses a self made scanner
instead, which consists of sql_lex.cc and the lex_hash.h header
generated by the bundled gen_lex_hash tool
the lex and yacc files in the innobase stem back from the time when
InnoDB was meant to be a standalone SQL database, most of this parser
is not in use anymore, parts of it are still needed to parse foreign
key constraint definitions though as far as i remember.