Skip to main content



      Home
Home » Modeling » Epsilon » Avoiding keywords in model properties
Avoiding keywords in model properties [message #1760226] Mon, 24 April 2017 15:47 Go to next message
Eclipse UserFriend
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 15: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 16:29 Go to previous messageGo to next message
Eclipse UserFriend
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 17: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 04:06 Go to previous messageGo to next message
Eclipse UserFriend
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 05:18 Go to previous messageGo to next message
Eclipse UserFriend
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 05:20 Go to previous messageGo to next message
Eclipse UserFriend
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 06:19 Go to previous message
Eclipse UserFriend
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: Wed Jul 02 23:42:45 EDT 2025

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

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

Back to the top