Eclipse tooling for the feature request DSL using Xtext and Xtend
- The Xtext grammar specification is located here.
- The Xtend model transformation specification is located here.
This project is developed and tested with:
- Java 17 (OpenJDK Eclipse Temurin)
- Eclipse (Eclipse Modeling Tools) version 2023-03
- Xtext version 2.30.0
- Have an OpenJDK 17 aktiv on your system (
java --version
must return 17.x) - Install Eclipse Modeling Tools https://www.eclipse.org/downloads/packages/release/2023-09/r/eclipse-modeling-tools
- Open Eclipse for the first time and create an empty workspace
- Go to Help -> Eclipse Marketplace and install the Xtext plugin. Follow the instructions and restart eclipse once it asks you to do so.
- Clone this repository somewhere
- Go to File -> Import -> General -> Existing Projects into Workspace
- Select the feature-dsl-tools root folder in the top selection. Under "Projects" select all shown parts. Make sure nothing is selected under "Options"
- Finish the import. Some tasks will be executed and the project parts appear on the left side Model Explorer. Some errors and warnings may appear.
- The important files are located in
de.tud.st.featurelang/src
. There you find theFeatureLang.xtext
, theGenerateFeatureLang.mwe2
and under generator theMain.java
andFeatureLangGenerator.xtend
files. - Right-click on the mwe2 file and select Run-As -> mwe2 Workflow. This step should lead to a successful build process.
- If the build output looks succesfull, but there are still error icons in the Model Explorer, open the Problems view (typically on the right side) and delete all warnings. Repeat the mwe2 build. The errors should be gone now.
- This build step is always necessary to synchronise changes made in the .xtext file to the project.
- The
.xtext
file contains the grammar specification. See the official Xtext docs for more information - The
.xtend
file contains the compiler translating the grammar syntax tree into the output string sequence. - To export the project, go to File -> Export as Runnable Jar and select "Copy libraries into JAR". The Lauch configuration must be the
Main.java
.- In case no launch configuration can be selected, go to the Main class in the Model Explorer -> Right click -> Run. The will fail due to missing input parameters but afterwards it is selectable in the export dialog.
- To actually execute the language tool, create a file with the ending
.featurelang
and place your input request inside. Calljava -jar [export].jar [input path] [output path]