Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EVL] word "model"
[EVL] word "model" [message #513452] Wed, 10 February 2010 09:53 Go to next message
Alvaro Jimenez Rielo is currently offline Alvaro Jimenez Rielo
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 #513456 is a reply to message #513452] Wed, 10 February 2010 05:02 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
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 #513460 is a reply to message #513456] Wed, 10 February 2010 10:19 Go to previous messageGo to next message
Alvaro Jimenez Rielo is currently offline Alvaro Jimenez Rielo
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
Re: [EVL] word "model" [message #513476 is a reply to message #513460] Wed, 10 February 2010 05:52 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Alvaro,

Are you using the latest version of Epsilon (0.8.8)? "" was the escape
sequence until 0.8.7 but we changed this to `` so that we can use "" for
string literals (in addition to ''). You can have a look at
http://www.eclipse.org/gmt/epsilon/doc/articles/eol-syntax-u pdates/ for
more updates in the syntaxes of Epsilon languages.

Cheers,
Dimitris

ajimenezr wrote:
> 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


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Re: [EVL] word "model" [message #586024 is a reply to message #513460] Wed, 10 February 2010 10:34 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Alvaro,

Are you using the latest version of Epsilon (0.8.8)? "" was the escape
sequence until 0.8.7 but we changed this to `` so that we can use "" for
string literals (in addition to ''). You can have a look at
http://www.eclipse.org/gmt/epsilon/doc/articles/eol-syntax-u pdates/ for
more updates in the syntaxes of Epsilon languages.

Cheers,
Dimitris

ajimenezr wrote:
> 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


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Previous Topic:[EVL] word "model"
Next Topic:attaching eugenia generated diagram with editor
Goto Forum:
  


Current Time: Thu Oct 23 17:53:21 GMT 2014

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

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