Hi,
I have the next grammar.
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"
Model:
greetings+=Greeting*;
Greeting:
'h' h=Hello
'w' w=World
'Hello' hello=[Hello]'-'
;
Hello:
name=ID
;
World:
name=Name
;
terminal ID : '^'?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
terminal Name : '^'?('a'..'z'|'A'..'Z') ('a'..'z'|'A'..'Z'|'-'|'0'..'9')*;
It gives the problem " mismatched input 'hello-' expecting RULE_ID " when I write:
h hello
w a-b
Hello hello-
However, it is ok if I write white spaces between [Hello] and '-' :
h hello
w a-b
Hello hello -
Of course, this issue disappear If the '-' charater is changed for another character in the Name terminal rule.
I have no idea of what to do to solve this.
Thanks!