1 grammar robots.missions.TaskDSL with org.eclipse.xtext.common.Terminals
3 generate taskDSL "http://www.missions.robots/TaskDSL"
12 Mission: 'Mission' name=ID 'using' behaviours+=[Behaviour]+ 'and stops when' se=StoppingExpression;
15 '(' op=Operator s+=StoppingExpression s+=StoppingExpression+ ')' |
16 scond=StoppingCondition
20 'Collected at least' colors+=Color+ |
21 'Touched on' touch=LeftRight |
22 'Distance' op=Comparison dist=INT 'cm' |
23 'Color is' color=Color;
25 Behaviour: 'Behaviour' name=ID
26 'take control:' tc=StoppingExpression?
27 'action:' actions+=Action+;
30 whichMotor=LeftRight 'motor' dir=Direction ('with speed' spd=INT 'acceleration' acc=INT)? |
33 Time: time=INT 'ms' | {Time} 'forever';
35 Direction: d=DirectionE;
36 enum DirectionE: BACKWARDS = 'backward' | FORWARDS = 'forward';
37 Operator: d=OperatorE;
38 enum OperatorE: AND = 'and' | OR = 'or';
39 Comparison: d=ComparisonE;
40 enum ComparisonE: GE='>' | LE='<';
41 LeftRight: d=LeftRightE;
42 enum LeftRightE: LEFT='left' | RIGHT='right';
45 BLACK='Black' | BLUE='Blue' | BROWN='Brown' | CYAN='Cyan' |
46 DARKGRAY='DarkGray' | GRAY='Gray' | GREEN='Green' |
47 LIGHTGRAY='LightGray' | MAGENTA='Magenta' | ORANGE='Orange' | PINK='Pink' |
48 RED='Red' | WHITE='White' | YELLOW='Yellow';