Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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 messageGo to next message
Eclipse UserFriend
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 09:13 Go to previous message
Eclipse UserFriend
You might try to add an

import org.example.domainmodel.domainmodel.DomainmodelPackage;

(if it isn't already imported)
Previous Topic:JET2 Exception with existing files
Next Topic:Extending Acceleo Templates
Goto Forum:
  


Current Time: Thu Jul 17 13:08:21 EDT 2025

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

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

Back to the top