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 06:29 Go to next message
Dan Barr is currently offline Dan Barr
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 03:51 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 4444
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 04:00 Go to previous message
Karsten Thoms is currently offline Karsten Thoms
Messages: 331
Registered: July 2009
Location: Dortmund
Senior Member

Did you already generate the language's implementation by running the MWE2 workflow? Is there a class "DomainmodelPackage" in src-gen?

Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Previous Topic:[Xpand/Xtend] Check File problem
Next Topic:MWE and Check language
Goto Forum:
  


Current Time: Tue May 28 14:53:33 EDT 2013

Powered by FUDForum. Page generated in 0.01445 seconds