LionWeb-CSharp 0.2.4-rc.5

This is a prerelease version of LionWeb-CSharp.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package LionWeb-CSharp --version 0.2.4-rc.5
                    
NuGet\Install-Package LionWeb-CSharp -Version 0.2.4-rc.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LionWeb-CSharp" Version="0.2.4-rc.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LionWeb-CSharp" Version="0.2.4-rc.5" />
                    
Directory.Packages.props
<PackageReference Include="LionWeb-CSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LionWeb-CSharp --version 0.2.4-rc.5
                    
#r "nuget: LionWeb-CSharp, 0.2.4-rc.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LionWeb-CSharp@0.2.4-rc.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LionWeb-CSharp&version=0.2.4-rc.5&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=LionWeb-CSharp&version=0.2.4-rc.5&prerelease
                    
Install as a Cake Tool

README

This project contains the C# implementation of (parts of) the LionWeb specification. Specifically supported are:

For convenience, the UML representation of the LionCore M3 meta-metamodel, including the separate LionCore built-ins language, is reproduced here:

A UML representation of the LionCore M3 meta-metamodel and LionCore built-ins

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 INamed interface – because many concepts have a "name" property,
  • the generic Node concept – 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 of INode, release version declaration
    • M2/: LionCore built-ins
    • M3/: implementation of the LionCore M3 to define languages with, computed properties and extension methods defined on top of those, and (de-)serialization of language definitions
    • Serialization/: implementation of (de-)serialization for the Node type, and definition of the serialization chunk format (after it's been unmarshalled from JSON)
    • Utilities/: utilities like Cloner, Comparer, or ReferenceUtils
  • 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on LionWeb-CSharp:

Package Downloads
LionWeb-CSharp-Generator

A generator that generates C# source code from a LionWeb M2

LionWeb-CSharp-Generator-MpsSpecific

This package contains a LionWeb language to express specifics of JetBrains MPS in C#

LionWeb.Generator.MpsSpecific

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0-rc.6 137 6/5/2025
0.3.0-rc.5 222 5/15/2025
0.3.0-rc.4 217 5/12/2025
0.3.0-rc.3 159 4/29/2025
0.3.0-rc.2 98 4/25/2025
0.3.0-rc.1 138 4/24/2025
0.2.4-rc.9 134 4/3/2025
0.2.4-rc.8 123 2/12/2025
0.2.4-rc.7.eol.1 81 2/12/2025
0.2.4-rc.7 89 2/11/2025
0.2.4-rc.5 105 2/4/2025
0.2.4-rc.4 83 1/28/2025
0.2.4-rc.3 106 1/20/2025
0.2.4-rc.2 68 1/20/2025
0.2.4-rc.1 64 1/17/2025
0.2.4-beta.1 77 2/9/2025
0.2.4-beta.0 54 1/15/2025
0.2.3 107 1/13/2025
0.2.3-rc.2 63 1/13/2025
0.2.3-rc.1.1 55 1/15/2025
0.2.3-rc.1 100 12/4/2024
0.2.2 163 10/21/2024
0.2.2-rc.7 90 9/17/2024
0.2.2-rc.6 126 7/16/2024
0.2.2-rc.5 68 7/11/2024
0.2.2-rc.4 70 7/9/2024
0.2.2-rc.3 58 7/9/2024
0.2.2-rc.2 66 7/5/2024
0.2.2-rc.1 89 7/5/2024