What would be the best solution for multiple language generation?

I'm currently writing a DSL based on baseLanguage, and at the end I'm generating Java code. It works pretty well.

Now, I'm wondering: if I want to be able to also generate Python code or C++ code from my DSL, what would be the best approach to do it?

1 comment
Comment actions Permalink

Two approaches:

1. Create separate generator plans for Python, C++, and Java and create a main plan that forks into those three plans. This is the best approach currently.

2. Have a generator generate three placeholder concepts from each root: one for each of Python, Java, and C++. Then create three separate rules to transform the placeholders into Python, Java, or C++.

0

Please sign in to leave a comment.