Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand] validation syntax
[Xpand] validation syntax [message #1052634] Tue, 30 April 2013 10:29 Go to next message
Dan Barr is currently offline Dan BarrFriend
Messages: 10
Registered: April 2013
Junior Member
Hi,

Im following the xPand tutorial and Im attempting to validate my dsl using the following:


@Check
	def checkGreetingStartsWithCapital(Entity greeting) {
		if (!Character::isUpperCase(greeting.name.charAt(0))) {
 warning("Name should start with a capital", 
      DomainmodelPackage$Literals::TYPE__NAME);
	}}


However it domainmodelpackage cannot be resolved to a type, when I opened the file the example text had MyDslpackage but this also doesnt work, I have named my files the same as the tutorial.

What should I be looking for to put in here?

Thanks
Re: [Xpand] validation syntax [message #1052901 is a reply to message #1052634] Wed, 01 May 2013 07:51 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10329
Registered: July 2009
Senior Member
Hi,

this looks like an Xtext check written in the new Xtend.
The XXPackage Class is generated by your Xtext Language Workflow. So it may be MydslPackage or something else in your case.
Re: [Xpand] validation syntax [message #1053473 is a reply to message #1052634] Mon, 06 May 2013 08:00 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 487
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Did you already generate the language's implementation by running the MWE2 workflow? Is there a class "DomainmodelPackage" in src-gen?
Re: [Xpand] validation syntax [message #1140589 is a reply to message #1052634] Wed, 16 October 2013 13:13 Go to previous message
su san is currently offline su sanFriend
Messages: 1
Registered: October 2013
Junior Member
You might try to add an

import org.example.domainmodel.domainmodel.DomainmodelPackage;

(if it isn't already imported)
Previous Topic:[Acceleo]Acceleo does not see metamodels located in targetplatform
Next Topic:MWE and Check language
Goto Forum:
  


Current Time: Wed Mar 29 03:33:52 GMT 2017

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

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