Results 1 to 5 of 5

Thread: Parser

  1. #1
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Parser

    Is there a good parser/lexer that generates valid C++ code because all I've found was just C ones and I don't want to rely on dependencies like antlr does with java . And has good cross-platform support? and well documented?
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Parser

    Are you looking for a parser, a parser generator or a code generator ? (your question is not clear about that...)

    Writing a fully correct parser for C++ is *extremely hard*, if possible at all. However if you only need to understand a subset of C++, or to extract for some pieces of data (for, e.g, class browsing) it is doable. Depends on your requirement really.

    Some potentially useful references :


    I've written some C++ parsers myself but they don't qualify as full parsers : they were either just lexers (for syntax highlighting) or permissive extractors (for code browsing and code completion)
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #3
    Join Date
    Jun 2006
    Posts
    11
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Parser

    Using ANTLR one can choose target language as C++/Python etc.

  4. #4
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Parser

    Sorry. I wanted to write a little basic scripting language in C++.
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  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: Parser

    So you want a parser generator Apart from sources already given you can search for bison or qlalr (the latter if you use Qt).

Similar Threads

  1. java parser
    By mickey in forum General Programming
    Replies: 13
    Last Post: 14th October 2008, 22:11
  2. HTML parser using Qt3
    By lni in forum Qt Programming
    Replies: 3
    Last Post: 3rd July 2007, 21:47
  3. Qt4 open src mingw from a PC to another
    By nvictor in forum Installation and Deployment
    Replies: 11
    Last Post: 1st May 2007, 17:41
  4. sax xml parser, QtXml
    By parmanax in forum Newbie
    Replies: 2
    Last Post: 24th April 2007, 23:05
  5. Parser in Qt.... HELP!
    By deepusrp in forum Newbie
    Replies: 6
    Last Post: 23rd January 2007, 21:18

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.