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;
19 'Collected at least' colors+=Color+ |
20 'Touched on' touch=LeftRight |
21 'Distance' op=Comparison dist=INT 'cm' |
22 'Color is' color=Color;
24 Behaviour: 'Behaviour' name=ID
25 'take control:' tc=StoppingExpression?
26 'action:' actions+=Action+;
29 whichMotor=LeftRight 'motor' dir=Direction ('with speed' spd=INT 'acceleration' acc=INT)? |
32 Time: time=INT 'ms' | {Time} 'forever';
34 Direction: d=DirectionE;
35 enum DirectionE: BACKWARDS = 'backward' | FORWARDS = 'forward';
36 Operator: d=OperatorE;
37 enum OperatorE: AND = 'and' | OR = 'or';
38 Comparison: d=ComparisonE;
39 enum ComparisonE: GE='>' | LE='<';
40 LeftRight: d=LeftRightE;
41 enum LeftRightE: LEFT='left' | RIGHT='right';
44 RED='Red' | GREEN='Green' | BLUE='Blue' | YELLOW='Yellow' |
45 MAGENTA='Magenta'| ORANGE='Orange'| WHITE='White' | BLACK='Black' |
46 PINK='Pink' | GRAY='Gray' | LIGHTGRAY='LightGray' |
47 DARKGRAY='DarkGray' | CYAN='Cyan' | BROWN='Brown';