SQL syntax

Help
Pascal
2007-10-13
2013-05-28
  • Pascal

    Pascal - 2007-10-13

    Hello,
    first of all thanks for this work !

    My question is about the SQL parser : I notice that reserved words "OR","BY" in "ORDER BY", "ROWNUM",  and other words are not in the list, as for usual functions like "LOWER", "UPPER", "LENGTH", "NVL", "TO_CHAR", "REPLACE"... and also comments between "/*" and "*/" are not recognized.
    Do you planned a new version of the RText.jar or can you explain to me how to add these words  ? (I don't see how you translate the SQLTokenMaker.flex to SQLTokenMaker.java...)

    Thank you.

     
    • Pascal

      Pascal - 2007-10-13

      OK, after reading the JFlex process, I just modified the SQLTokenMaker.class and it works (almost for some added words) !
      I'm going now to distinct the different words instead of simply RESERVED_WORD, and affect them to FUNCTION, DATA_TYPE...

      What I'm looking for now is to change the colour between string values and char values.

      I look in other parsers you made to be inspire.

       
    • Robert Futrell

      Robert Futrell - 2007-10-13

      Hi Pascal,

      Yes, you do have to hack the flex-generated scanner file a little to get it to work in RText, but I'm glad you got it working!  Adding new keywords and adding the standard multiline comment shouldn't be too bad (for the multiline comment, you can just take that out of CTokenMaker or JavaTokenMaker).  If you get it working the way you expect, if you send me the updated SQLTokenMaker.flex you're using, we can get it added into the next RText release.

      Let me know!

       
    • Robert Futrell

      Robert Futrell - 2007-11-15

      Pascal,

      Since I haven't heard back from you, I took the liberty of adding the stuff you suggested myself.  I didn't add any vendor-specific extensions, even though that seems to be the bulk of SQL.  If there are enough users who want vendor-specific stuff added, I'll be happy to add them.

      Expect to see these changes in the next release!

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks