I agree with S. Lott that you should write an example of what you want to generate.
Solving the problem with code generation should be less complicated than without.
This is because your general program needs to deal with a lot of input data, and if a subset of this information changes very rarely, for example, once a week, the code generator should only install this subset. Generated code conditions on the remaining input, which changes more often. This is a strategy of separation and conquest. Another name for him is "partial assessment".
Generated code should also run much faster because it is less general.
In your particular case, there is no harm in creating code in 2 (or more) passes. As in step 1, you generate ads. In step 2, you generate the process code. Alternatively, you can generate two output streams and concatenate them at the end.
Hope this helps. Sorry if I just say that is obvious.
Mike Dunlavey Nov 21 '08 at 14:32 2008-11-21 14:32
source share