I'm new to Xtext and I'm trying to create a simple DSL for railway systems, here's my grammar :
Model:
(trains+=Train)*
| (paths+=Path)*
| (sections+=Section)*
;
Train:
'Train' name=ID ':'
'Path' path=[Path]
'Speed' speed=INT
'end'
;
Path:
'Path' name=ID ':'
'Sections' ('{' sections+=[Section] (',' sections+=[Section] )+ '}' ) | sections+=[Section]
'end'
;
Section:
'Section' name=ID ':'
'Start' start=INT
'End' end=INT
('SpeedMax' speedMax=INT)?
'end'
;
But when I put this code at the Eclipse instance :
Section brestStBrieux :
Start 0
End 5
end
Section StBrieuxLeMan :
Start 5
End 10
end
Section leManParis :
Start 1
End 12
end
Path brestParis :
Sections { brestStBrieux, StBrieuxLeMan, leManParis}
end
Train tgv :
Path brestParis
Speed 23
end
I got this error three times:
mismatched input '0' expecting RULE_INT
mismatched input '1' expecting RULE_INT
mismatched input '5' expecting RULE_INT
I can't see where those errors come from, what can I do to fix them. Any idea?