Code generation

Started by
3 comments, last by Tosh777 4 years, 6 months ago

Hello, I need a tool which can generate c++ code, more precisely - for each string in some file to generate one header and one cpp file, and to add some functions in several files. 

What do you guys use in such scenarios? Of course I can write such generator myself in Python, but if you have better advice I would listen.

 

Advertisement

Well, what more could you wish for than a multi-purpose scripting language loaded with libraries? For text processing, learning to use regex also comes in handy from time to time.

That said, being proficient in at least one scripting language is highly recommended. It's like having a Swiss army knife. You should have one and use it extensively.

You won't find a better solution than doing it by your own. You can go from simple text processing to complex token processing solutions but I don't think there is a library for it. The reason is simple, you have to provide templates for how your code should be generated from an input language. So instead of writing template code and use the input language, printing some strings into a file is a more easy solution

Thanks for the answers. In the end I wrote the code generation code myself.

This topic is closed to new replies.

Advertisement