Generating text from a model - GText vs textGen

Hello, all.

In MPS, there seem to be two primary ways to generate text from a model (GText & textGen).  GText seems to be a declarative, model-to-model style of text generation, while textGen seems to take a more imperative approach.  It looks like GText is built on top of textGen.

Is this an accurate summary of the options available in MPS for text generation?  When would it be appropriate to use GText instead of textGen, and vice versa?  Can (or should) you mix and match pieces from GText and textGen when creating text output for a language?

Thanks for your guidance. :-)

Robert

2 comments
Comment actions Permalink

Hello, Robert,

It's better to use gtext since you use higher level model to model transformation. TextGen was created in order to generate baseLanguage, since it's harder to generate base language in a way similar to gtext transformation (we have to track and add imports at the beginning of a file). Internally, gtext is implemented with text gen but since it's done once, you can use gtext for your languages.

Regards,

Konstantin

0
Comment actions Permalink

Hello, Konstantin,

Thanks for the explanation.  I will use gtext to implement text generation for models, then. :-)

Thank you for your assistance!

Robert

0

Please sign in to leave a comment.