One area you should study is the Expression class. Although I anticipate a rewrite of the functionality sooner or later (1) a tree structure will still be used for the compiled statements.
Each node of the tree has a member variable for its type (constant, column value, etc.), depending on the expression it represents. The output of the parser for a given SQL statement or a whole stored procedure, will be an expression tree. We want the new parser to generate the expression tree directly, performing the syntax checks in the process. After this, separate compiler code that is unrelated to the parser will check the semantics and optimise the expression if possible. I think the main challenge in introducing the new Parser will be the construction of the expression tree without writing any code for special cases of SQL statements. I think this will very likely require modifying any lexer / parser that we might use. Fred (1) rewrite of functionality is needed (even in the present codebase) to support features such as unparsing (producing SQL statement text from the tree), uniform treatment of functions and selects that are not currently an instance of Expression. ----- Original Message ----- From: "刘欣" <[EMAIL PROTECTED]> To: "hsqldb-developers" <[EMAIL PROTECTED]> Sent: 23 July 2004 15:06 Subject: [Hsqldb-developers] Re:store procedure -new lexer and parser hi,all i'm liuxin, you can call me "ender", I lived in beijing,china. I'm glad to join hsqldb team and hope to give some contriutions to hsqldb. I started to study source code yesterday, especially jdbcConnection.java, jdbcStatement.java,Database.java, Parser.java,DatabaseCommandInterpreter.java... . I found a parser was build handly,not generated by machine ,it's very fast for parsing and executing sql, but the code is not easy to read and not very clear( maybe it's my problem :-) ), Maintenance would be annoying when store procedures are joined ,as fredt said, a grammar based approach is needed, I'm experienced in JavaCC, the following days i'm going to learn JFlex and Antler, try to find which is the fastest lexer. I'd like to do some work on grammar and tests. ender ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ hsqldb-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hsqldb-developers ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ hsqldb-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hsqldb-developers