Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Avoiding keywords in model properties
Avoiding keywords in model properties [message #1760226] Mon, 24 April 2017 19:47 Go to next message
Sina MadaniFriend
Messages: 160
Registered: November 2015
Location: York, UK
Senior Member
Hello,

I was wondering if there is a way to get the property of a model in Epsilon languages if the metamodel element name is the same as a keyword?
For example, in EVL I have the following code:

context Movie {
constraint isValidTitle {
check: self.title.length() > 0
}
}

The problem is that "title" is a keyword in EVL and the parser treats it as a keyword. I was unable to find a "getProperty" operation on model elements in the book (there is a "hasProperty" on Any but no way to retrieve the property that I could find).
Re: Avoiding keywords in model properties [message #1760227 is a reply to message #1760226] Mon, 24 April 2017 19:59 Go to previous messageGo to next message
Eclipse UserFriend
This is a typical problem I also had before. You can use

<model element name>.`<property name>`


.
Re: Avoiding keywords in model properties [message #1760228 is a reply to message #1760227] Mon, 24 April 2017 20:29 Go to previous messageGo to next message
Sina MadaniFriend
Messages: 160
Registered: November 2015
Location: York, UK
Senior Member
Thanks! Just out of interest, is this documented anywhere in the book or any of the articles?
Re: Avoiding keywords in model properties [message #1760231 is a reply to message #1760228] Mon, 24 April 2017 21:26 Go to previous messageGo to next message
Eclipse UserFriend
I don't remember seeing it in the book. It is better Dimitris answers this question.
Re: Avoiding keywords in model properties [message #1760248 is a reply to message #1760231] Tue, 25 April 2017 08:06 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Hi both,

An example of using backticks is shown in Figure 10.3 ("Flock migration strategy for the process-oriented metamodel...") of the book and explained in the footnote on page 149 (not the most prominent of places - I agree).

Cheers,
Dimitris
Re: Avoiding keywords in model properties [message #1760263 is a reply to message #1760248] Tue, 25 April 2017 09:18 Go to previous messageGo to next message
Sina MadaniFriend
Messages: 160
Registered: November 2015
Location: York, UK
Senior Member
Thanks Dimitris. Would it be useful if I wrote an article about it (under the "Epsilon Object Language" section) to make this feature more visible?
Re: Avoiding keywords in model properties [message #1760265 is a reply to message #1760263] Tue, 25 April 2017 09:20 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Hi Sina,

This is also mentioned in https://www.eclipse.org/epsilon/doc/articles/eol-syntax-updates/. How about contributing a patch for the book?

Cheers,
Dimitris
Re: Avoiding keywords in model properties [message #1760269 is a reply to message #1760265] Tue, 25 April 2017 10:19 Go to previous message
Sina MadaniFriend
Messages: 160
Registered: November 2015
Location: York, UK
Senior Member
Hi Dimitris,

Thanks for pointing that out. I will try to add it to an appropriate section of the book.
Previous Topic:Import Ecore packages into EVL
Next Topic:Problem running ETL transformation
Goto Forum:
  


Current Time: Thu Apr 18 22:50:01 GMT 2024

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

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

Back to the top