The limited features of the GCC preprocessor helps us control the versions of code easily along with giving macros and other stuff.

But is there a software out there (preferably open-source) that helps us define complex language rules, that later get "preprocessed" to the C language? The "powerful" preprocessor must be enough to let us define rules similar to the C++ language. This is just a random thought that occurred to me. So is there a software out there that does this?

  • Did you look at e.g. lex and yacc? – albert Dec 28 '16 at 18:44
  • Certainly "early" versions of C++ were implemented as a pre-parser that generated C code that was then actually compiled - I am not 100% sure that this this is no longer the case. – Steve Barnes Dec 29 '16 at 7:27
  • I just had a hunch that this kind of software might exist. I wanted to use one if possible, just to play around with it! – Sreram Dec 29 '16 at 7:34
  • You can probably use any templating system – Mawg says reinstate Monica Jul 5 '19 at 6:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.