Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Does Moc uses handwritten C++ parser ?
QtWS25 Last Chance

Does Moc uses handwritten C++ parser ?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
mocinternal
3 Posts 3 Posters 399 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    noone
    wrote on 7 Feb 2022, 07:25 last edited by
    #1

    I heard that parsing C++ is really hard. So how does moc does this ? does it use libclang or libtooling ?

    J 1 Reply Last reply 7 Feb 2022, 07:27
    0
    • N noone
      7 Feb 2022, 07:25

      I heard that parsing C++ is really hard. So how does moc does this ? does it use libclang or libtooling ?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 7 Feb 2022, 07:27 last edited by
      #2

      @noone In case you don't get an answer here: moc is open source, so you can check how it is implemented.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • K Offline
        K Offline
        kkoehne
        Moderators
        wrote on 7 Feb 2022, 08:12 last edited by
        #3

        It's a hand-written parser. It doesn't need to understand all of C++ though, because it's only interested in class declarations etc.

        As @jsulm pointed out, it's open source, see https://code.qt.io/cgit/qt/qtbase.git/tree/src/tools/moc :)

        Director R&D, The Qt Company

        1 Reply Last reply
        4

        2/3

        7 Feb 2022, 07:27

        • Login

        • Login or register to search.
        2 out of 3
        • First post
          2/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved