update with colors etc, we now need to test it on physical robots
[des2015.git] / dsl / xtend / src / robots / missions / validation / TaskDSLValidator.xtend
1 /*
2 * generated by Xtext
3 */
4 package robots.missions.validation
5
6 //import org.eclipse.xtext.validation.Check
7 /**
8 * This class contains custom validation rules.
9 *
10 * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation
11 */
12 class TaskDSLValidator extends AbstractTaskDSLValidator {
13
14 // public static val INVALID_NAME = 'invalidName'
15 //
16 // @Check
17 // def checkGreetingStartsWithCapital(Greeting greeting) {
18 // if (!Character.isUpperCase(greeting.name.charAt(0))) {
19 // warning('Name should start with a capital',
20 // MyDslPackage.Literals.GREETING__NAME,
21 // INVALID_NAME)
22 // }
23 // }
24 /* @Check
25 def checkStoppingExpressionShouldHaveOneBehaviourToCollectColor(Mission mission) {
26 var isCollectColorExist = false;
27 if (!mission.se.scond.colors.nullOrEmpty) {
28 var blist = mission.behaviours;
29 for (var j = 0; j < blist.size; j++) {
30 if (!blist.get(j).clcColor.nullOrEmpty) {
31 isCollectColorExist = true;
32 }
33 }
34 }
35 if (!isCollectColorExist) {
36 error("Must specify one behaviour to collect color", null)
37 }
38 }*/
39 }