Skip to main content
GameDev.net gamedev.net
🔒 Locked

Code generation

Started by Tosh777 Oct 2, 2019 at 11:25 AM 3 replies 3.2k views
Original Post
Tosh777
Tosh777

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.


Prototype
Prototype

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.

Shaarigan
Shaarigan

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

Tosh777
Tosh777

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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.