|
Re: Enable or disable grammatical rule by file extension [message #1711928 is a reply to message #1711892] |
Tue, 20 October 2015 10:36 |
|
You can't disable that in the grammar, but you can simulate the behavior, so the effect will be the same for the end user. Do this by implementing a semantic validation rule for HELLO: If the EObjects's resource file extension is mydsl1, then create an error. Further, tweak the content assist to suppress the 'Hello' keyword if the resource file extension is mydsl1.
As an effect, the user does not see that he could enter 'Hello' where it would by syntactically possible, and if he uses it anyway, he gets a validation error after parsing.
HTH,
~Karsten
Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03306 seconds