Generate code in two different areas in a file

I have a specific structure in my language. For this structure, I want to be able to either use generator and/or textgen to be able to generate different code in two different areas. Is this possible? For example, maybe I want to create a field at the top of the class, and assign it somewhere in a function.

1 comment
Comment actions Permalink
Sure, this is possible. It is actually a pretty common scenario, that you generate an item into some sort of declaration together with references to it scattered across the model.

There are many options that the generator gives you - I'd recommend that you go through the Generator tutorial -, which is specifically targeted towards exploring all the options of the generator. It builds on the knowledge acquired in the introductory tutorials, namely the Shapes tutorial ( and the Fast Track tutorial (


Please sign in to leave a comment.