Chapter 4. Validation
In this chapter we will introduce the concept of validation, and in particular, the Xtext mechanism to implement validation: the validator. With validation you can implement additional constraint checks of a DSL which cannot be done at parsing time. Xtext allows you to implement such constraint checks in an easy and declarative way; furthermore, you only need to communicate to Xtext the possible errors or warnings and it will take care of generating the error markers accordingly in the IDE. The validation will take place in the background while the user of the DSL is typing in the editor, so that an immediate feedback is provided. We will also show how to implement quickfixes corresponding to the errors and warnings generated during validation, so that we can help the user to solve problems due to validation errors.