removed LCD class
[des2015.git] / dsl / xtend / src / robots / missions / TaskDSL.xtext
index afefa5d..7fb398a 100644 (file)
@@ -13,30 +13,38 @@ Mission:
 
 StoppingExpression:
        '(' op=Operator s+=StoppingExpression s+=StoppingExpression+ ')' |
-       'not ' negscond=StoppingCondition |
+       'not ' negscond=StoppingExpression |
        scond=StoppingCondition;
 
 StoppingCondition:
-       'Collected at least' colors+=Color+ |
+       'flag set' varName=ID |
        'Touched on' touch=LeftRight |
        'Light on' light=LeftRight |
        'Distance dangerous at ' dist=BackFront |
-       'Color is' color=Color;
+       'Color is' color=Color |
+       {StoppingCondition} 'Never';
 
-Behaviour: 'Behaviour' name=ID 
+Behaviour: 'Behaviour' name=ID
        'take control:' tc=StoppingExpression?
-       'action:' actions+=Action+;
+       'action:' actions+=Action+
+       ;
 
 Action:
        whichMotor=LeftRight 'motor' moveDir=Direction ('with speed' spd=INT 'acceleration' acc=INT)? |
-       'turn' turnDir=LeftRight degrees=INT ('with speed' spd=INT 'acceleration' acc=INT)? |
-       {Action} 'measure'|
-       'wait' time=Time;
+       'turn' turnType=Turn ('with speed' spd=INT 'acceleration' acc=INT)? |
+       'measure' rl=RockLake|
+       'wait' time=Time |
+       'set flag' varName=ID;
+       
+Turn:
+       turnDir=LeftRight 'exactly' degrees=INT 'degrees'|
+       'randomly' start=INT 'to' end=INT 'degrees'
+;
 
 Time: time=INT 'ms' | {Time} 'forever';
  
 RockLake: d=RockLakeE;
-enum RockLakeE: ROCK='rock' | LAKE='lake';
+enum RockLakeE: ROCK='Rock' | LAKE='Lake';
 Direction: d=DirectionE;
 enum DirectionE: BACKWARDS = 'backward' | FORWARDS = 'forward';
 Operator: d=OperatorE;