Hello, I've started to study the BNF grammar files of SQL92 (http://cui.unige.ch/db-research/Enseignement/analyseinfo/SQL92/BNFindex.html and http://www.contrib.andrew.cmu.edu/%7Eshadow/sql/sql2bnf.aug92.txt).
I noticed a strange thing: the definition of identifier with rules instead of regular expression used by the lexer. Since one lexer is very fast (compared to a parser), I suggest to rewrite some parts of the SQL92 grammar as made in the AxionSQLParser.jj or SQL.jj (from Mckoi) to make the grammar more simple to read. Moreover, we will have to add the HSQLDB specific rules. Here is a simple roadmap for this: -1- rewrite the SQL92 grammar (in text or html format) and introduce lexer tokens such as identifier, integer, real... define states (used by the lexer) for comments and litterals. -2- add the HSQLDB specific rules -3- write the lexer (use one that already exists or from scratch) -4- write the parser (use one that already exists or from scratch) -5- tests (SQL syntax, performance...) steps 3-4-5 are repeated until the results are conform with the target: a fast SQL statements analyzer. What do you think? Loic note: wondersonic == loic ;o) ; personnal (week-end) versus work (week) e-mail ---------------------- Envoyà par Loic LEFEVRE/FR/EUROPE/GROUP le 30/07/2004 09:53 --------------------------- Internet [EMAIL PROTECTED] - 29/07/2004 22:34 Pour : Loic LEFEVRE cc : Objet : Re: RÃf. : RE: [Hsqldb-developers] Is there any douments about the code? Hi Loic, Sure, as you said before one should start to write the grammer at some point. Specifically, it would be a good idea to use the names used by the SQL 92, 99 and 03 standards (you need to replace spaces with the underscore). These you can find in the standards texts, but it seems some people have compiled them into BNF or similar grammar files. If there is no licensing issue, we can use such files as a starting point. Please go to the link that Campbell posted to find an SQL92 grammar file. (there is also a link to one on our homepage) I think you and Liuxin could form a good partnership. You are very capable in getting things done while it seems he is more into deep theory than practice (he is an assistant researcher in China's Academy of Computer Science, a highly respected institution). I won't be heavily involve in this until it gets to the point of building expressions, which I will have to incorporate into the rest of the engine. Fred ----- Original Message ----- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 29 July 2004 15:53 Subject: RÃf. : RE: [Hsqldb-developers] Is there any douments about the code? Hello, What do you think about it? Loic Internet [EMAIL PROTECTED]@lists.sourceforge.net - 28/07/2004 23:04 Envoyà par : [EMAIL PROTECTED] Pour : fredt, hsqldb-developers cc : Objet : RE: [Hsqldb-developers] Is there any douments about the code? If you intend to write a parser for the supported HSQLDB-SQL syntax, you should begin to write the grammar. It will help you to identify the common parts plus it will easily help to define the terminals for the lexer and the regular expressions to define integers, decimals, identifiers and so on. Here is a (very) little extract of what may be done as a first step: Lo?c -----Message d'origine----- De?: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de fredt EnvoyÃ?: mercredi 28 juillet 2004 19:28 Ã?: hsqldb-developers Objet?: Re: [Hsqldb-developers] Is there any douments about the code? There aren't any document. Try to debug Parser.ParseSelect(...). This calls private methods of Parser to build the expression tree. Parser methods call Tokenizer methods for tokens. Fred ----- Original Message ----- From: "liuxin" <[EMAIL PROTECTED]> To: "hsqldb-developers" <[EMAIL PROTECTED]> Sent: 28 July 2004 16:01 Subject: [Hsqldb-developers] Is there any douments about the code? I dived into the source code using some test cases to debug step by step those days ,but still confused, any documents will be appreciated! liuxin [EMAIL PROTECTED] 2004-07-28 ------------------------------------------------------- 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 (See attached file: HSQLDB-grammar.html) ??????????????????????????????????????????????????? ???????????????????????????????????????????????????????? ??????????????????????????????????????????????????????????? ?????????????????????????????????????????????????????????? ??????????????????????????????????????????????????????????? ?????????????????????????????????????????????????????????????? ????????????????????????????????????????????????? ???????????????????????????????????????????????????? ????????????????????????????????????????????????? ????????????????????????????????????????????????????????????? ????????????????????????????????????????????????????? ??????????????????????????????????????????????????????? ???????????????????????????????????????????????????????? ????????????????????????????????????????????????????????? ???????????????????????????????????????????????????? ??????????????????????????????????????????????????????? ??????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????? ???????????????????????????????????????????????????????? ?????????????????????????????????????????????????????????? ??????????????????????????????????????????????????? This message and any attachments (the "message") is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. The internet can not guarantee the integrity of this message. BNP PARIBAS (and its subsidiaries) shall (will) not therefore be liable for the message if modified. --------------------------------------------- Ce message et toutes les pieces jointes (ci-apres le "message") sont etablis a l'intention exclusive de ses destinataires et sont confidentiels. Si vous recevez ce message par erreur, merci de le detruire et d'en avertir immediatement l'expediteur. Toute utilisation de ce message non conforme a sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. L'internet ne permettant pas d'assurer l'integrite de ce message, BNP PARIBAS (et ses filiales) decline(nt) toute responsabilite au titre de ce message, dans l'hypothese ou il aurait ete modifie. ------------------------------------------------------- This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com _______________________________________________ hsqldb-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hsqldb-developers