Lower & upper bounds on variables - #431
Merged
Merged
Conversation
Member
|
I checked the feature branch out and gave it a try. Unfortunately, I get Java compiler errors within the generated code of multiple gips-test projects. Is this some local Eclipse issue on my system? Can you please verify that all of the tests pass on your system, @MarkBeB? Thanks! |
Collaborator
Author
|
Yes, I forgot to rebuild the test projects after making changes to the code generator. Everything seems to be working properly now. |
Member
Alright, thank you very much! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR introduces new optional syntax to GIPSL for setting upper and lower bounds on type and mapping variables. This will resolve #421 . Tests can be found here Echtzeitsysteme/gips-tests#146
After defining the type of a variable, the inclusive bounds are specified within brackets (
[ <lower> , <upper> ]), separated by a comma. If a lower or upper bound is not needed, an asterisk (*) can be used as a placeholder.The syntax is validated to ensure that the lower bound is always less than or equal to the upper bound. If the lower bound exceeds the upper bound, a validation error is triggered.
Examples:
var variableA : EInt [0 , 5](lower bound: 0, upper bound 5)var variableB : EInt [* , 7](no lower bound, upper bound 7)var variableC : EDouble [1.5 , *](lower bound: 1.5 , no upper bound)