UVL - Universal Variability Language
UVL (Universal Variability Language) is a concise and extensible language for modeling variability in software product lines. It supports multiple programming languages and provides a grammar-based foundation for building tools and parsers.
This repository contains the ANTLR4 grammar files for UVL. With these, you can generate parsers for UVL tailored to specific programming languages like Java, JavaScript, and Python.
✨ Key Features
- Language-level modularity
- Namespaces and imports
- Feature trees with attributes and cardinalities
- Cross-tree constraints
- Extensible for different target languages
📦 Repository Structure
uvl/UVLParser.g4– Base grammar in EBNF formuvl/UVLLexer.g4– Base lexer grammar for UVLuvl/Java/UVLJava*.g4,uvl/Python/UVLPython*.g4, etc. – Language-specific grammar filesjava/– Java-based parser implementation using Mavenpython/– Python-based parser implementationjavascript/– JavaScript-based parser implementationtests/– UVL test cases for validation
UVL uses ANTLR4 as its parser generator.
💡 Language Overview
Each UVL model may consist of five optional sections:
- Language levels: Enable optional concepts via
includekeyword. - Namespace: Allows referencing the model from other UVL models.
- Imports: Include other feature models (e.g.,
subdir.filename as fn). - Feature tree: Hierarchical features with cardinalities, attributes, and group types (
mandatory,optional,or,alternative). - Cross-tree constraints: Logical and arithmetic constraints among features.
🔍 Example
namespace Server
features
Server {abstract}
mandatory
FileSystem
or
NTFS
APFS
EXT4
OperatingSystem {abstract}
alternative
Windows
macOS
Debian
optional
Logging {
default,
log_level "warn"
}
constraints
Windows => NTFS
macOS => APFS
Explanation:
Serveris an abstract feature.- It must include a
FileSystemand anOperatingSystem. Loggingis optional and includes an attribute.- Logical constraints define dependencies between features.
🔗 More examples: https://github.com/Universal-Variability-Language/uvl-models/tree/main/Feature_Models
Usage
To use UVL in your projects, you can either:
- Use the pre-built parsers
Java Parser
Include the following dependency in your Maven project:<dependency> <groupId>io.github.universal-variability-language</groupId> <artifactId>uvl-parser</artifactId> <version>0.3</version> </dependency>
Python Parser
Install the package via pip:pip install uvlparser
JavaScript Parser
Install the package via npm:npm install uvl-parser
- Build the parser manually See the sections below for details.
⚙️ Building the Parser manually
Java Parser
Prerequisites
Build Steps
- Clone the repository:
git clone https://github.com/Universal-Variability-Language/uvl-parser
- Build the parser:
cd java
mvn clean package
- Include the generated JAR in your Java project.
📚 Resources
UVL Models & Tools
Tooling Ecosystem
- https://github.com/FeatureIDE/FeatureIDE
- https://ide.flamapy.org/
- https://github.com/Universal-Variability-Language/uvl-lsp
- https://github.com/SECPS/TraVarT
- https://github.com/AlexCortinas/spl-js-engine
📖 Citation
If you use UVL in your research, please cite:
@article{UVL2024,
title = {UVL: Feature modelling with the Universal Variability Language},
journal = {Journal of Systems and Software},
volume = {225},
pages = {112326},
year = {2025},
issn = {0164-1212},
doi = {https://doi.org/10.1016/j.jss.2024.112326},
url = {https://www.sciencedirect.com/science/article/pii/S0164121224003704},
author = {David Benavides and Chico Sundermann and Kevin Feichtinger and José A. Galindo and Rick Rabiser and Thomas Thüm},
keywords = {Feature model, Software product lines, Variability}
}
📬 Contact & Contributions
Feel free to open issues or pull requests if you have suggestions or improvements. For questions or collaboration inquiries, visit the UVL Website: https://universal-variability-language.github.io/
Metadata
Release files for uvlparser 2.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| uvlparser-2.5.0.tar.gz | 29.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| uvlparser-2.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 59.7 kB
Release files / uvlparser-2.5.0.tar.gz
| Download URL | uvlparser-2.5.0.tar.gz |
|---|---|
| Size | 29.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc6ea8d83be9a6eba17babffe79e369f0b8984493b1b5f2eed7b8952e01385b8
|
|
BLAKE2b-256 checksum How to use checksums |
519e803d5dcba1884597752ff9e322824289254de45ca62387e8b3cd1cf0609a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / uvlparser-2.5.0-py3-none-any.whl
| Download URL | uvlparser-2.5.0-py3-none-any.whl |
|---|---|
| Size | 29.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
783391510eb9379a5a7d4a8c1d1df2f0f90060e1c2480819855966667d93c502
|
|
BLAKE2b-256 checksum How to use checksums |
c364282bbed99b1ed18d99f95e1b9960723041c98eb954c1f0d343c363c90a83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for uvlparser 2.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.