Simple Feature Models DSL
Simple Feature Models DSL is a small project to create feature models textually and export them as
images with GraphViz for auto-layout. I started
the project when I was trying to edit feature diagrams in PowerPoint, resulting in time-consuming layout
activities.
Intended audience
- Users that often deal with feature models and their documentation, and that feel layout should not be part of their job
- Developers that want to use the project as a study object to learn how to develop a textual DSL with
the Xtext Language Development Framework
Features
- Free and open source Eclipse plugin
- Simple domain-specific language (DSL) for feature modeling
- Supports or and xor feature groups
- Supports mandatory and optional cardinalities for solitary features
- Supports 'feature-as-concept' relation for hierarchical feature modeling
- Exports dot files as an input for GraphViz
- Exports svg and png files directly if GraphViz is installed
- Svg export supports 'feature-as-concept' relations as links between svg files
- Svg export supports feature documentation as mouse-over tooltips
Example Input

Example Output

You should know this, too
- The project is realized with the
Xtext Language Development Framework and GraphViz.
- The project is provided as-is. I will sporadically update or bugfix the program as the need
arises for my purposes. But if you miss a certain feature: Go grab the sources and implement them on your own!
From SourceForge.net
The complete Project can be downloaded from the
Sourceforge project page via the project page's
Files link.
The project contains:
- The software distribution as a set of Eclipse plugins
- The complete source code
Note that this page serves as the documentation. For everything else, you can
contact me or read the comments in the source code.
Requirements
The project is implemented in Java as an Eclipse plugin and has only modest system requirements.
A client should meet at least the following requirements:
- Operating System: Everything that runs Eclipse
- Java Version: J2SE-1.5 or greater
- Eclipse Xtext v1.0.1 (or greater?)
Put the jars in your Eclipse's plugin folder
Follow these simple steps:
- Download the software distribution.
- Unzip the software distribution zip file. You get three jar files that represent Eclipse plugins:
- 'featuremodel' represents the core DSL and contains the grammar definition.
- 'featuremodel.generator' represents the generator to generate the dot, svg and png files.
- 'featuremodel.ui' represents the IDE-specific stuff such as editor views and a project wizard.
- Put the jar files of the software distribution into the 'plugins' folder of your Eclipse installation.

- Restart your Eclipse if necessary.
Note: In order to generate not only dot files as an input for GraphViz, but also svg and png images directly, you have to install GraphViz and add it to your classpath.
Getting things started
Create new Project
Open Eclipse w/ Xtext and the SFM plugins installed. Go to 'New->Other'.
In the 'Select a wizard' dialog, go to 'Xtext->SimpleFeatureModel Project', then click 'Next'.
In the 'SimpleFeatureModel Project' dialog, insert a project name, then click 'Finish'.
Project Structure
In the new project, there are already two feature models as an example. They are located in the 'model' package.
One of the examples looks as follows. 
You also get a nice outline view. 
Generate Feature Diagrams
Right-click on the file 'Generator.mwe2'. This is the generator workflow that generates the dot and the image files for your feature models. In the context menu, select 'RunAs->MWE2Workflow' to generate the images.
If you have GraphViz instalöled, your 'src-gen' folder should now look as follows. For each of your feature models, you should find a dot file and an svg and png image for further use.
Open the generated svg file 'dataflowfeatures.svg'. As you can see, it opens nicely in Firefox. Your short descriptions are rendered as tooltips when you hover the mouse over the respective features or concepts. But most important, the 'feature-as-concept' relationship between feature models is repersented as working links between svg feature diagrams. 
Concete and abstract Syntax
Language Metamodel

Xtext Grammar

Example

Generated Image from Example

Stefan Gudenkauf
The best way to contact me is to send me an e-mail: stefan ((at)) gudenkauf ((dot)) de