Space validation [message #1804314] |
Fri, 22 March 2019 06:36  |
Eclipse User |
|
|
|
Hi,
I want to validate the white space character between two elements and raise warning if more than one space.
Please find my 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*|LgInstruction;
Greeting:
'Hello' name=ID '!';
AutoNetArg: tag=ID ('=' value=ID)?
;
LgInstruction :
{LgInstruction} 'lg'(args+=(AutoNetArg))*
;
my language code is
Hello world
lg name=wip value=auto
in LG command, after LG keyword, more than one space is allowed, if it is more than one space, raise warnings.
In validator, I am able to get only the String tokens, how to do space validation between lg keyword and next elements.
Tanks for your kind help
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06645 seconds