On this page ...
LionWeb Integration
LionWeb
The LionWeb initiative (see LionWeb @ Github) aims to make language engineering
tools interoperable on the web.
LionWeb does this by specifying
- how language definitions and models can be interchanged in a well-defined JSON format.
- a server protocol for storing and retrieving models in a repository.
Next to the specification, LionWeb also provides implementations of supporting software in languages like TypeScript, JavaScript,
Java, Kotlin, C#.
These packages support a wide range of functionality like:
- (de)serialization between in-memory models and JSON format
- model diff
- model validation
- etc.
There also is a lionweb-repository package that implements a LionWeb server for model storage using the LionWeb server protocol.
Freon and LionWeb
The LionWeb idea of interoperability fits perfectly with the basic principles of Freon, to be open and extensible.
Freon uses LionWeb in various ways as described in the sections below.
The use of LionWeb allows other tools access not only to the models, but also to the languages that are defined in Freon.
It also means that there is no lock-in when using Freon.
Both the languages and models created with Freon are fully accessible anywhere else.
Store models in LionWeb Format
Freon stores models in LionWeb JSON format on the server, allowing other tools to access the models.
Using the LionWeb Repository
Optionally use the LionWeb server protocol to store models in the lionweb-repository.
This option is still in beta, as we want to do more testing.
- To run the lionweb-repository see the GitHub page https://github.com/LionWeb-io/lionweb-repository. Once the lionweb-repository is running, the following two lines in `starter.ts`
import { ServerCommunication } from "@freon4dsl/core";
WebappConfigurator.getInstance().setServerCommunication(ServerCommunication.getInstance()); need to be changed to:
import { LionWebRepositoryCommunication } from "@freon4dsl/core"
WebappConfigurator.getInstance().setServerCommunication(LionWebRepositoryCommunication.getInstance()); Convert Freon Language Definition to LionWeb
- Optionally convert the Freon language definition (the .ast files) to a LionWeb language definition
in LionWeb JSON format. - This is done by the following command:
This will create a filefreon lionweb-it -d src/defs -o src/freonsrc/freon/lionweb/<LanguageName>.jsoncontaining the LionWeb
definition for<languageName>.
Note that this is a beta feature.