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...
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