Skip to content
Balazs Simon edited this page Oct 11, 2022 · 4 revisions

MetaDslx languages for defining DSLs

The MetaDslx framework provides three custom languages for creating your own Domain Specific Languages (DSLs):

The Meta-Model language provides a compact and human readable way of describing meta-models. The MetaDslx framework generates C# classes from this Meta-Model description. These C# classes form the basis of the implementation of the meta-model.

The Meta-Generator language is a user friendly template language for generating program code or any other output. The MetaDslx framework translates Meta-Generator code to C# classes. When the generator is used, this C# class will be executed. This C# class performs all the operations defined in the generator. A generator can traverse any C# (or .NET) object graph passed to it, including an instance of a meta-model.

The Meta-Compiler language can be used to define a custom textual domain-specific language (DSL) by specifying the grammatical rules of the DSL. Based on these grammar descriptions the MetaDslx framework generates a Roslyn-style immutable compiler for your language. The generated compiler uses the fast and powerful ANTLR4 for parsing, it provides automatic semantic analysis based on the semantic annotations, and it builds an instance of a meta-model automatically.

Combining the Meta-Model, the Meta-Compiler and the Meta-Generator languages you can build powerful DSLs in C#.

Clone this wiki locally