Results 1 to 5 of 5

Thread: sql compiler with qt

  1. #1
    Join Date
    Jan 2016
    Posts
    3
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Red face sql compiler with qt

    Hi. Im working now to create sql mini compiler. And i want to know
    How to do the lexical analysis function to recognise my words
    .what should i do ''PLCs''or i can just create a table contain
    All my keywords to compare it with my qstring
    Please help me .thank you all

  2. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: sql compiler with qt

    If you are going to parse anything other than a simple syntax structure, you should look at flex and bison...
    I write the best type of code possible, code that I want to write, not code that someone tells me to write!

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: sql compiler with qt

    I agree with jefftee. While you could certainly use a lookup table (QHash or QSet)to recognize the keywords in your SQL vocabulary, you will also need to recognize non-keywords like table and column identifiers, constants, wildcards, and so forth, and then create expression trees from all of it. This would be easier done using lex / yacc or flex / bison (or the C++ counterparts flex++ / bison++).

  4. #4
    Join Date
    Jan 2016
    Posts
    3
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Red face Re: sql compiler with qt

    Quote Originally Posted by d_stranz View Post
    I agree with jefftee. While you could certainly use a lookup table (QHash or QSet)to recognize the keywords in your SQL vocabulary, you will also need to recognize non-keywords like table and column identifiers, constants, wildcards, and so forth, and then create expression trees from all of it. This would be easier done using lex / yacc or flex / bison (or the C++ counterparts flex++ / bison++).
    Thank you very much

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: sql compiler with qt

    Quote Originally Posted by d_stranz View Post
    I agree with jefftee. While you could certainly use a lookup table (QHash or QSet)to recognize the keywords in your SQL vocabulary, you will also need to recognize non-keywords like table and column identifiers, constants, wildcards, and so forth, and then create expression trees from all of it. This would be easier done using lex / yacc or flex / bison (or the C++ counterparts flex++ / bison++).
    If one is using Qt, qlalr is also an option.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. The following user says thank you to wysota for this useful post:

    d_stranz (2nd February 2016)

Similar Threads

  1. Replies: 2
    Last Post: 11th March 2014, 12:02
  2. Qt Creator Parse compiler errors of a non gcc compiler
    By kiozen in forum Qt Tools
    Replies: 4
    Last Post: 4th July 2011, 01:34
  3. msvc Compiler or mingw compiler
    By Ashutosh2k1 in forum Qt Programming
    Replies: 3
    Last Post: 14th February 2011, 08:33
  4. Strange compiler behaviour (compiler passes wrong argument)
    By SasaVilic in forum General Programming
    Replies: 2
    Last Post: 2nd November 2010, 11:36
  5. Qt or Compiler bug?
    By jrideout in forum Qt Programming
    Replies: 5
    Last Post: 2nd March 2006, 21:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.