What are some techniques for code generation?

前端 未结 8 1170
抹茶落季
抹茶落季 2021-01-06 13:05

I\'m generating C++ code, and it seems like it\'s going to get very messy, even my simple generating classes already have tons of special cases. Here is the code as it stan

8条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-06 13:32

    One technique I've used for code generation is to not worry at all about formatting in the code generator. Then, as a next step after generating the code, run it through indent to format it reasonably so you can read (and more importantly, debug) it.

提交回复
热议问题