🚀 MetaBNF is a language designed in JetBrains MPS that allows developers to describe and generate domain-specific languages (DSLs) using an extended Backus-Naur Form (BNF) notation.
With MetaBNF, you can define a DSL in a familiar grammar-like syntax and automatically generate MPS Concepts, Editors, and Language Components.
✅ Define languages using BNF-style notation
✅ Generate MPS Concepts, Properties, References, and Editors
✅ Extend with custom annotations for additional MPS features
✅ Automate language creation inside JetBrains MPS
A simple expression language using MetaBNF:
// Root Node with Child of 0..n
< WorkBook > ::= { BNFStatements } ;
// Abstract Concept definition
<< **BNFStatements** >> ::= <no expr>
// extends BNFStatements
< EmptyLine (A) > ::= <no expr> ;
// Interface definition with an optional Child
<I `IBNFBaseStatement` I>
::= [ BNFExpression as expr ] ;
<< BNFExpression >> ::= <no expr>
🔥 This MetaBNF definition will generate:
✔️ Expression
, BinaryOperation
, Number
, and Variable
as MPS Concepts
✔️ Operator
as an MPS Enumeration
✔️ Structure-aware editors inside MPS
- JetBrains MPS 2023.2.2 or newer
- Java 17+
- (Optional) Git for cloning the repo
- mbeddr.core available due to some dependencies
git clone https://github.com/porscheofficial/MetaBNF.git
cd MetaBNF
- Open JetBrains MPS
- Import the project via File → Open Project
- Create a new MPS Solution
- Add a new model and use the MetaBNF editor
- Define a simple grammar and run the generator
- Use the generated language inside MPS! 🚀
🚧 We're actively developing MetaBNF! Future updates will include:
- MPS UI Integration
- Custom Syntax Extensions
- Improved Error Checking & Validation
Check out our Wiki for more details!
We welcome contributions! Here's how you can help:
✅ Submit issues for bugs or feature requests
✅ Fork & create pull requests with improvements
✅ Join the discussion in our community
🔗 Check out our Contribution Guide
MetaBNF is open-source under the Apache 2.0.
Dependency to included packages into project:
- com.mbeddr:mbeddr
- com.mbeddr:platform
- de.itemis.mps:mps-gradle-plugin
- com.jetbrains:mps
- org.apache.ant:ant-junit