Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EVL] word "model"
[EVL] word "model" [message #585982] Wed, 10 February 2010 09:53 Go to next message
Alvaro Jimenez Rielo is currently offline Alvaro Jimenez RieloFriend
Messages: 41
Registered: July 2009
Location: Rey Juan Carlos Universit...
Member
Hello !

I'm using EVL to validate GMF diagrams which their metamodel root's name is "Model".
I have this constraint:

constraint UniqueName {
guard : self.satisfies('validStructuredTypeName')
check : self.model.datatype->select(p|p.isTypeOf(StructuredType))->select(s|s.Name = self.Name)->size() = 1
message : 'UDT Name should be unique'
fix{
title: self.Name + ' -> Choose other Name'
do {
self.Name :=UserInput.prompt('Choose other Name', self.Name);
}
}
}

Eclipse highlights "model" as a reserved word and when I validate a diagram I receive the following error:
bundleresource://781/model/ORDB4ORA.evl has one or more syntax errors :
Line: 70, Column: 22, Reason: mismatched input: '.'

Line 70 is :
check : self.model.datatype->select(p|p.isTypeOf(StructuredType))->select(s|s.Name = self.Name)->size() = 1

Is "model" a reserved word?
In affirmative case: How do I use "model" like not-reserved word?


Álvaro Jiménez Rielo
Kybele Research Group
Rey Juan Carlos University (Madrid)
Re: [EVL] word "model" [message #585998 is a reply to message #585982] Wed, 10 February 2010 09:58 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Alvaro,

Reserved words can be escaped by enclosing them into `` (e.g.
self.`model`.datatype)

Cheers,
Dimitris

ajimenezr wrote:
> Hello !
>
> I'm using EVL to validate GMF diagrams which their metamodel root's name
> is "Model". I have this constraint:
>
> constraint UniqueName {
> guard : self.satisfies('validStructuredTypeName')
> check :
> self.model.datatype->select(p|p.isTypeOf(StructuredType))->select(s|s.Name
> = self.Name)->size() = 1
> message : 'UDT Name should be unique'
> fix{
> title: self.Name + ' -> Choose other Name'
> do {
> self.Name :=UserInput.prompt('Choose other Name',
> self.Name);
> }
> }
> }
>
> Eclipse highlights "model" as a reserved word and when I validate a
> diagram I receive the following error:
> bundleresource://781/model/ORDB4ORA.evl has one or more syntax errors :
> Line: 70, Column: 22, Reason: mismatched input: '.'
>
> Line 70 is :
> check :
> self.model.datatype->select(p|p.isTypeOf(StructuredType))->select(s|s.Name
> = self.Name)->size() = 1
>
> Is "model" a reserved word? In affirmative case: How do I use "model"
> like not-reserved word?
>
> Álvaro Jiménez Rielo
> Kybele Research Group Rey Juan Carlos University (Madrid)


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Re: [EVL] word "model" [message #586010 is a reply to message #585998] Wed, 10 February 2010 10:19 Go to previous message
Alvaro Jimenez Rielo is currently offline Alvaro Jimenez RieloFriend
Messages: 41
Registered: July 2009
Location: Rey Juan Carlos Universit...
Member
Hi Dimitris,

I have tried your solution self.`model`.datatype and it hasn't worked
but I have used "reservedword" (self."model".datatype) and it works!

Thanks (one more time).

Álvaro Jiménez Rielo
Previous Topic:regarding Eugenia generated diagram
Next Topic:[EVL] word "model"
Goto Forum:
  


Current Time: Fri Mar 29 11:46:31 GMT 2024

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

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

Back to the top