Implementing colors collection and mission exit
[des2015.git] / dsl / xtend / src / robots / missions / TaskDSL.xtext
index 9c14fa3..456ac4c 100644 (file)
@@ -13,8 +13,7 @@ Mission: 'Mission' name=ID 'using' behaviours+=[Behaviour]+ 'and stops when' se=
 
 StoppingExpression:
        '(' op=Operator s+=StoppingExpression s+=StoppingExpression+ ')' |
-       scond=StoppingCondition
-;
+       scond=StoppingCondition;
 
 StoppingCondition:
        'Collected at least' colors+=Color+ |
@@ -24,7 +23,7 @@ StoppingCondition:
 
 Behaviour: 'Behaviour' name=ID 
        'take control:' tc=StoppingExpression?
-       'action:' actions+=Action+;
+       'action:' actions+=Action+ (clcColor='collect color')?;
 
 Action:
        whichMotor=LeftRight 'motor' dir=Direction ('with speed' spd=INT 'acceleration' acc=INT)? |
@@ -42,7 +41,7 @@ LeftRight: d=LeftRightE;
 enum LeftRightE: LEFT='left' | RIGHT='right';
 Color: d=ColorE;
 enum ColorE:
-       BLACK='Black' | BLUE='Blue' | BROWN='Brown' | CYAN='Cyan' |
-       DARKGRAY='DarkGray' | GRAY='Gray' | GREEN='Green' | 
-       LIGHTGRAY='LightGray' | MAGENTA='Magenta' | ORANGE='Orange' | PINK='Pink' |
-       RED='Red' | WHITE='White' | YELLOW='Yellow';
\ No newline at end of file
+       RED='Red' | GREEN='Green' | BLUE='Blue' | YELLOW='Yellow' | 
+       MAGENTA='Magenta'| ORANGE='Orange'|     WHITE='White' | BLACK='Black' | 
+       PINK='Pink' | GRAY='Gray' | LIGHTGRAY='LightGray' |
+       DARKGRAY='DarkGray' | CYAN='Cyan' | BROWN='Brown';
\ No newline at end of file