1 grammar robots.missions.TaskDSL with org.eclipse.xtext.common.Terminals
3 generate taskDSL "http://www.missions.robots/TaskDSL"
12 'Mission' name=ID 'using' behaviours+=[Behaviour]+ 'and stops when' se=StoppingExpression;
15 '(' op=Operator s+=StoppingExpression s+=StoppingExpression+ ')' |
16 'not ' negscond=StoppingExpression |
17 scond=StoppingCondition;
20 'Collected at least' colors+=Color+ |
21 'Touched on' touch=LeftRight |
22 'Light on' light=LeftRight |
23 'Distance dangerous at ' dist=BackFront |
24 'Color is' color=Color;
26 Behaviour: 'Behaviour' name=ID
27 'take control:' tc=StoppingExpression?
28 'action:' actions+=Action+;
31 whichMotor=LeftRight 'motor' moveDir=Direction ('with speed' spd=INT 'acceleration' acc=INT)? |
32 'turn' turnType=Turn ('with speed' spd=INT 'acceleration' acc=INT)? |
37 turnDir=LeftRight 'exactly' degrees=INT 'degrees'|
38 'randomly' start=INT 'to' end=INT 'degrees'
41 Time: time=INT 'ms' | {Time} 'forever';
43 RockLake: d=RockLakeE;
44 enum RockLakeE: ROCK='rock' | LAKE='lake';
45 Direction: d=DirectionE;
46 enum DirectionE: BACKWARDS = 'backward' | FORWARDS = 'forward';
47 Operator: d=OperatorE;
48 enum OperatorE: AND = '&&' | OR = '||';
49 BackFront: d=BackFrontE;
50 enum BackFrontE: BACK = 'back' | FRONT = 'front';
51 LeftRight: d=LeftRightE;
52 enum LeftRightE: LEFT='left' | RIGHT='right';
55 RED='Red' | GREEN='Green' | BLUE='Blue' | YELLOW='Yellow' |
56 MAGENTA='Magenta'| ORANGE='Orange'| WHITE='White' | BLACK='Black' |
57 PINK='Pink' | GRAY='Gray' | LIGHTGRAY='LightGray' |
58 DARKGRAY='DarkGray' | CYAN='Cyan' | BROWN='Brown';