Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » def initialized with alternatives (or)
def initialized with alternatives (or) [message #987183] Sat, 24 November 2012 08:43 Go to next message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

I need to define a def: which depends on two different alternatives in or.
Precisely I am validating a DSL and I need to retrieve the type of a variable. This depends on the where the variable was defined. It may be for instance a parameter of a method, a property of a class, a local variable. Then I thought to create a def, typed as ocl::OclElement, in the context of the Variable meta-class initialized by these three different possibilities in or. Am I doing the right thing?


Follow me on Twitter @andreasindico

Re: def initialized with alternatives (or) [message #987190 is a reply to message #987183] Sat, 24 November 2012 10:28 Go to previous messageGo to next message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

A better solution may be defining a set but It seems I am making some syntactical error.
I am doing something like

def: type: Set = {variable.<the first possible element>, variable.<the second possible element>}

or

def: type: Set{} = {variable.<the first possible element>, variable.<the second possible element>}

but in both the cases I get an error.

Also as the two elements of the set are mutually exclusive would this solution be feasible?


Follow me on Twitter @andreasindico

Re: def initialized with alternatives (or) [message #987193 is a reply to message #987190] Sat, 24 November 2012 10:57 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You don't explain your problem clearly enough for me to understand "in
or" is not English.

You don't identify what errors you give or provide sufficient context to
reproduce the error.

A zipped project demonstrating your best attempt is nearly always a good
way to avoid wasting my time (and yours).

Regards

Ed Willink


On 24/11/2012 10:28, Andrea Sindico wrote:
> A better solution may be defining a set but It seems I am making some
> syntactical error.
> I am doing something like
>
> def: type: Set = {variable.<the first possible element>, variable.<the
> second possible element>}
>
> or
> def: type: Set{} = {variable.<the first possible element>,
> variable.<the second possible element>}
>
> but in both the cases I get an error.
>
> Also as the two elements of the set are mutually exclusive would this
> solution be feasible?
Re: def initialized with alternatives (or) [message #987207 is a reply to message #987183] Sat, 24 November 2012 13:30 Go to previous message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

the right form is

def: type: Set = Set{<first element>, <second element>}


Follow me on Twitter @andreasindico

Previous Topic:Custom OCL error messages
Next Topic:Using OCL MDT sources from git
Goto Forum:
  


Current Time: Fri Apr 19 21:43:22 GMT 2024

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

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

Back to the top