[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-internals
Subject:    Re: extend the SQL statement of MySQL
From:       Konstantin Osipov <konstantin () mysql ! com>
Date:       2006-03-29 19:12:10
Message-ID: 20060329191210.GU22542 () dragonfly ! local
[Download RAW message or body]

Hello 吴飞林,

* 吴飞林 <feeling@cse.buaa.edu.cn> [06/03/29 05:51]:

> I want to extend the SQL statement of MySQL on windows32. For example,I want to \
> make the following statement valid.  
> <create_policy_stmt>::= 
> CREATE SECURITY POLICY policy_name [<with_option>] 
> <with_option>::= 
> WITH OPTION {{NO}|{LABEL UPDATE}| {CHECH CONTROL}}[,…] 
> 
> I think there are two parts in MySQL, lexer and semantic parse.And I want to konw \
> that which file should I modify? 

sql_yacc.yy; you're adding new lex tokens, so you'll need to
modify lex.h to add support for them in the lexer. There you can
make sure that these new tokens do not become reserved words.
sql_parse.cc is an entry point where you can hook in an
implementation for the new command.

> 
> And I modify sql_yacc.cpp like this: 
> copy a linux version sql_yacc.yy to windows, use bison 2.1
> compile it. This will produce two files sql_yacc.cpp,
> sql_yacc.h, and I use them to instead the same file in
> windows version of MySQL source file. did I do it right? 

Is there a problem with invoking bison directly on Windows?

> Then I want to kown where can I add the new key words, since
> there is not any *.l file that can be compiled by flex. 

We use our own lexer (implemented in sql_lex.cc), gen_lex_hash.cc
builds a symbol table for it using the arrays defined in lex.h. 

-- 
Konstantin Osipov, Software Developer
MySQL AB, www.mysql.com

-- 
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/internals?unsub=mysql-internals@progressive-comp.com



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic