Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the feature modeling language with XOR, OR grouping and optionality #125

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

Lycheers
Copy link

@Lycheers Lycheers commented Feb 27, 2025

Description

We extended the feature model editor with the following options:

  • support xor and or operators for feature relationships
  • add ? syntax for optional features
  • new operators have a different highlighting than the feature names

We modified the grammar rule in FeatureModel.bnf to enable new operators and then added the definition of new tokens in the FeatureModel.flex. After that, we did the same thing for the FeatureModelHighlightingLexer.flex to allow a distinct coloring. We also need to define the tokens in the class FeatureModelSyntaxHighlighter.java and include cases when xor, or and ? are detected. Lastly, we have to change a minor part in FeatureModelAnnotator.java to disable the enforced feature coloring.

Related Issue

#42

Motivation and Context

Feature models in Clafer require support for grouping operators to match the language specification. With more boolean operators enabled, we are allowed to do more designs in the feature models. These changes improve usability and compliance with Clafer’s feature modeling semantics.

How Has This Been Tested?

  • Tests are created and passing
  • Manual testing
    We included the operators xor, or and ? into the given feature-model file in the Snake project and checked if errors occur. We also wrote a small test to check if xor, or and ? are really recognized as our defined tokens.

Demo:

Cross-Tree.dependency_demo.mp4

Types of changes

  • Pipeline changes
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I have updated the CONTRIBUTORS file.
  • I have updated the CHANGELOG.

Lycheers and others added 23 commits November 4, 2024 13:47
# Conflicts:
#	src/main/resources/META-INF/plugin.xml
# Conflicts:
#	src/main/java/se/isselab/HAnS/actions/FindChildrenAction.java
…solve, also OPTIONAL token is not matched at all
…es the coming feature(on the same indentation level) to unused feature and I tried with changing the highlighting for xor, or, ?, but they only changed the color shortly and then got covered
@Lycheers Lycheers changed the title Extend the feature modeling language with XOR, OR grouping and optionality Description Extend the feature modeling language with XOR, OR grouping and optionality Feb 27, 2025
@johmara johmara linked an issue Feb 27, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend the feature modeling language Cross tree dependencies
2 participants