How to Reuse Textx Model

133 Views Asked by At

I'm using textx (documentation) as DSL parser and my application would greatly benefit from re-use of both textx metamodels and models.

I tried with pickle, but I realized I can't pickle textx objects.

Any idea or suggestion?

1

There are 1 best solutions below

0
On

There is a support for grammar reuse using import keyword. Be aware that your grammar files must reside under the same tree as you can't import arbitrary path.

For splitting model and referencing elements across files there is a recent contribution which is not released at the time of this post but is merged into the master branch.

You can read about the contribution here and see final cleaned up version here.