Feature modelling language add support for xor, or and ? #128
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adapted the FeatureModelLexer to parse "xor", "or" and "?" tokens (The implementation is a bit clunky as we parsed the letters individually, as searching for the whole token did not work at first, but seems to work for other groups).
Modified FeatureModel.bnf to allow a ? token after every featurename and allow an or/xor to be used with at least to featurenames after it.
Modified FeatureModelHighlighter.flex to parse xor, or and ? tokens.
Added different colors in FeatureModelSyntaxHighlighter.java for the operator
Related Issue
#42
Motivation and Context
Extend the feature modelling language to allow a feature to be marked as optional and allow multiple features to be grouped by an or, or xor to follow Clafer definition.
How Has This Been Tested?
We tested it by adding multiple nested or and xor statements and optionality tokens in the snake project and see if any errors occured
Demo:
feature_modelling.mp4
Types of changes
Checklist: