LionWeb-CSharp
0.4.1
dotnet add package LionWeb-CSharp --version 0.4.1
NuGet\Install-Package LionWeb-CSharp -Version 0.4.1
<PackageReference Include="LionWeb-CSharp" Version="0.4.1" />
<PackageVersion Include="LionWeb-CSharp" Version="0.4.1" />
<PackageReference Include="LionWeb-CSharp" />
paket add LionWeb-CSharp --version 0.4.1
#r "nuget: LionWeb-CSharp, 0.4.1"
#:package LionWeb-CSharp@0.4.1
#addin nuget:?package=LionWeb-CSharp&version=0.4.1
#tool nuget:?package=LionWeb-CSharp&version=0.4.1
README
This project contains the C# implementation of (parts of) the LionWeb specification. Specifically supported are:
- language definition through the LionCore M3 meta-metamodel,
- serialization and deserialization of both languages and instances of those conforming to the LionWeb JSON serialization format,
- a generic, dynamic/reflective base implementation of nodes,
- C# type generation.
For convenience, the UML representation of the LionCore M3 meta-metamodel, including the separate LionCore built-ins language, is reproduced here:
The LionCore built-ins language contains several classifiers (=instances of Classifier, so reside on the M2-level because they don't admit a self-definition) that can be used within any language definition.
These specifically are
- the
INamedinterface – because many concepts have a "name" property, - the generic
Nodeconcept – to use as the type of the target(s) of an untyped reference relation, - the four built-in primitive types.
Project organization
Various aspects of LionWeb are represented as directories at the top-level of this project.
Core/:- base types, including
Node, a generic, dynamic/reflective implementation ofINode, release version declaration M2/: LionCore built-insM3/: implementation of the LionCore M3 to define languages with, computed properties and extension methods defined on top of those, and (de-)serialization of language definitionsSerialization/: implementation of (de-)serialization for theNodetype, and definition of the serialization chunk format (after it's been unmarshalled from JSON)Utilities/: utilities likeCloner,Comparer, orReferenceUtilsNotification/: LionWeb notification system API
- base types, including
docs/: documentation, mainly in the form of diagrams of that as well
API
Languages
Serializing instances of Language as a LionWeb serialization chunk can be done as follows:
// serialization to internal format:
using LionWeb.Core.M1;
SerializationChunk serializationChunk = new Serializer(LionWebVersions.Current).SerializeToChunk(languages);
// serialization of internal format to JSON:
using LionWeb.Core.Serialization;
JsonUtils.WriteJsonToFile(<path>, serializationChunk);
(Also note that code in these snippets – in particular the using statements – might not be syntactically correct.
Adjust before use.)
Deserializing a LionWeb serialization chunk containing one or more languages can be done as follows:
JsonUtils.ReadNodesFromStreamAsync(utf8JsonStream, new LanguageDeserializer(LionWebVersions.Current))
.GetAwaiter()
.GetResult()
.Cast<Language>();
Instances
Serializing nodes (as instances of Node) can be done as follows:
JsonUtils.WriteNodesToStream(utf8JsonStream, new Serializer(LionWebVersions.Current), <nodes>)
Deserializing a LionWeb serialization chunk that's the serialization of nodes from one language can be done as follows:
/// Configure and create deserializer:
var deserializer = new DeserializerBuilder()
.WithLanguage(<language instance>)
.Build();
// read the JSON:
var List<IReadableNode> nodes = JsonUtils.ReadNodesFromStreamAsync(utf8JsonStream, deserializer)
.GetAwaiter()
.GetResult();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Utf8JsonAsyncStreamReader (>= 1.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.4.1 | 36 | 3/4/2026 |
| 0.4.0 | 139 | 1/21/2026 |
| 0.4.0-alpha.8 | 247 | 12/17/2025 |
| 0.4.0-alpha.7 | 214 | 12/15/2025 |
| 0.4.0-alpha.6 | 205 | 12/15/2025 |
| 0.4.0-alpha.5 | 651 | 12/1/2025 |
| 0.4.0-alpha.4 | 371 | 11/21/2025 |
| 0.4.0-alpha.3 | 368 | 11/20/2025 |
| 0.4.0-alpha.2 | 370 | 11/18/2025 |
| 0.4.0-alpha.1 | 188 | 10/14/2025 |
| 0.3.0 | 196 | 10/13/2025 |
| 0.3.0-rc.13 | 206 | 10/13/2025 |
| 0.3.0-rc.12 | 167 | 10/7/2025 |
| 0.3.0-rc.11 | 160 | 9/26/2025 |
| 0.3.0-rc.10 | 231 | 9/23/2025 |
| 0.3.0-rc.9 | 246 | 9/19/2025 |
| 0.3.0-rc.8 | 131 | 9/12/2025 |
| 0.3.0-rc.7 | 150 | 9/9/2025 |
| 0.3.0-rc.6 | 213 | 6/5/2025 |