Closed farhan5248 closed 11 months ago
Given/Then The blah application/service, something/something/something/Object is (empty/present/as follows) When The blah request is sent (with/bad/as follows)
The Given/Then validation is to make sure we have all the info for a state in the finite state machine. The When validation is to make sure we have what we need for an triggering a transition without or with inputs.
The semantic validation will make sure that a sequence of three statements make an edge ie: given a state, when the named/blah edge/transition is triggered, then the next state is statement 3.
Add table column row validation, each row should have the max number of columns
Add tests for the two state and transition regex. I will use the examples in the error message. I'll need to fix any validation issues from the .xtext file
I should do this validation by updating the language definition but I'll start with something simpler which is to use regex. This will be enough to give someone more readable customised feedback. By more readable I mean that the Xtext default error messages are kind of unhelpful if plain confusing. Later I will understand how to customise the error messages and then move more of the validation into the language def. Also for someone new, it's probably easier to just use regex instead of complex language grammar definitions. The advantage of putting this validation in the xtext file is that you get an API to parse the statements automatically instead of making one like I have in the past.