0

I need write a metaobject compiler for C (like a MOC in Qt). I will add to *.c source own keywords and mechanisms (like slots/signals in Qt).

I'll represent this work in three stages:

  1. Writing C-code with own constructions
  2. Parsing and generation of new source file without own constructions using metaobject compiler.
  3. Compilation of file from stage 2 using, for example, GCC.

So, I have questions about second stage. MOC will be a pure C lexical analyzer/syntax analyzer with addition of analysing my constructions, right? Whether there are such pure C analyzers in the free access? Whether really to build in them parsing of my code? And generally, I think in the correct direction?

m.s.
  • 16,063
  • 7
  • 53
  • 88
dark
  • 167
  • 1
  • 6
  • 17
  • (1) Why can't you just use the Qt one directly? what do you need in particular (2) if you want to parse C / C++ AST's, I would recommend to use libclang to start I guess, and then modify it to support your MOC syntax. – Chris Beck Oct 18 '15 at 15:15
  • Check out "C Front End" for a list of possible bases for your "MOC" parser. – Ira Baxter Oct 18 '15 at 15:22

0 Answers0