|
Re: Validation error(...) Method Question [message #831980 is a reply to message #831969] |
Thu, 29 March 2012 15:42 |
|
On 03/29/2012 05:30 PM, Wladimir Schamai wrote:
> Hi all,
>
> I am struggling with the new error(...) validation method in Xtext 2.x.
> The documentation says:
>
> Quote:
>> The methods error(..) and warning(..) in the
>> AbstractDeclarativeValidator used to accept integer constants
>> representing the EStructuralFeature which caused the issues. These
>> integer parameters were replaced by the feature itself, e.g. from
>> error(String, Integer) to error(String, EStructuralFeature). Use the
>> generated EPackage to access the EStructuralFeature
>
>
> Can anyone tell me how to get EStructuralFeature for a rule? What
> EPackage is mentioned here?
> Thanks in advance
> Wladimir
you should use your DSL (generated) EPackage
for instance MyDslPackage, in particular
MyDslPackage.Literals
where you get all the structural features...
as far as I know, both error and warning should deal seamlessly with
null EStructuralFeature in case
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
Powered by
FUDForum. Page generated in 0.03364 seconds