Skip to main content



      Home
Home » Modeling » TMF (Xtext) » [SOLVED]Problem with Xtend keywords
[SOLVED]Problem with Xtend keywords [message #1369628] Tue, 20 May 2014 13:22 Go to next message
Eclipse UserFriend
Hello,

I am using a Xtext-Typesystem-API (https://code.google.com/a/eclipselabs.org/p/xtext-typesystem/) which provides me the following operaton:

 typeof(EObject obj, TypeCalculationTrace trace);


I want to use this operation in my : MydslValidator.xtend - class, but it is not possible because Xtend reserve this operationname as a keyword.

Is there a possibility to use this operation without wrapping it in an own Javaclass?

~Alex

[Updated on: Wed, 21 May 2014 05:04] by Moderator

Re: Problem with Xtend keywords [message #1369654 is a reply to message #1369628] Tue, 20 May 2014 13:38 Go to previous messageGo to next message
Eclipse UserFriend
Hi does it work to escape with ^keyword
Re: Problem with Xtend keywords [message #1369718 is a reply to message #1369654] Tue, 20 May 2014 14:11 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
you made my day (or better night..Smile)!!

Thank you! Is it maybe possible to define more than one validator? maybe one in Xtend and another one in Java?
I read something about it here: http://blog.dietmar-stoll.de/2013/04/multiple-validators-in-xtext.html but I'm not sure, that I can combine Java and Xtend validators.

~Alex
Re: Problem with Xtend keywords [message #1369812 is a reply to message #1369718] Tue, 20 May 2014 15:05 Go to previous messageGo to next message
Eclipse UserFriend
you can add subvalidators using the annotation @ComposedChecks on the main validator class
Re: Problem with Xtend keywords [message #1369813 is a reply to message #1369812] Tue, 20 May 2014 15:06 Go to previous messageGo to next message
Eclipse UserFriend
it does not play a role if they are written in java or in xtend
Re: Problem with Xtend keywords [message #1371153 is a reply to message #1369628] Wed, 21 May 2014 04:39 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I'm a litte bit confused, cause it didn't work out for me. I'm doing the following steps:

1. Adding a composedCheck in my XTEND-MyDslValidator:
@ComposedChecks (validators = { CustomValidator.class })
class MyDslValidator extends AbstractCdalfValidator{
..
}

2. Create a Javaclass in the same validation package that looks like this:
public class CustomValidator extends AbstractDeclarativeValidator{

}


Do I have to register the CustomValidator.class also in the xtext runtime module or maybe in the .mwe2 file?
I also getting the following error in the Xtend-Validator-class:

The value for an annotation attribute must be a constant expression

Thanks!
[SOLVED] Re: Problem with Xtend keywords [message #1371198 is a reply to message #1371153] Wed, 21 May 2014 05:03 Go to previous message
Eclipse UserFriend
I've opened a new post: http://www.eclipse.org/forums/index.php/m/1371197/#msg_1371197

[Updated on: Wed, 21 May 2014 05:04] by Moderator

Previous Topic:Best way to access Properties of a Class
Next Topic: [SOLVED] @ComposedChecks in MyDslValidator.xtend - class
Goto Forum:
  


Current Time: Wed Jul 16 06:58:57 EDT 2025

Powered by FUDForum. Page generated in 0.04908 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top