Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Namespace qualifiers and name collisions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jörn Guy  
View profile  
 More options Oct 30 2007, 8:28 pm
From: Jörn Guy <jgsu...@itee.uq.edu.au>
Date: Tue, 30 Oct 2007 17:28:53 -0700
Local: Tues, Oct 30 2007 8:28 pm
Subject: Namespace qualifiers and name collisions
I have a metamodel that contains cross references across packages. I
have an "instance" package, which contains model elements representing
samples for testing, and a "type" package, that contains model
elements describing the types that the instance have to comply with.
In order to make local operation simple, I reuse terms. hence there is
a type/Vector and an instance/Vector. I was wondering how I would
address these in the bindings of Tefkat rules?

If I do

NAMESPACE type
NAMESPACE instance

"Vector" will always resolve to type/Vector..

I would assume that their may be many cases in practice where such
namespace collisions occur. Especially, since the models may be
created seperately and certain popular 'pattern-like' terms like
'NamedElement' are bound to reappear...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
michael lawley  
View profile  
 More options Oct 30 2007, 9:07 pm
From: "michael lawley" <mich...@lawley.id.au>
Date: Wed, 31 Oct 2007 11:07:13 +1000
Local: Tues, Oct 30 2007 9:07 pm
Subject: Re: Namespace qualifiers and name collisions
Hi Jörn,

If you do the below, then "Vector" will be ambiguous - you have two
options.  One is to use the fully-qualified type name; assuming the
name of the package containing Vector in the metamodel "type" is
"type", and similarly for the metamodel "instance", then you would
write fully-qualified names ::type::Vector and ::instance::Vector to
disambiguate them.  The alternative is to import the metamodels into
different namespaces (this is required when the fully-qualified names
are the same, as may occur with different versions of the same
metamodel).  Thus:

NAMESPACE t type
NAMESPACE i instance

RULE matchVectors
  FORALL i^Vector inst, t^Vector type
  WHERE conforms(inst, type)
  MAKE println(inst, type)
;

Thus, two namespaces ("t" and "i") are defined for the transformation
and are populated by the names (simple and fully qualified) from the
associated metamodels.

michael

On 10/31/07, Jörn Guy <jgsu...@itee.uq.edu.au> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google