![]() | Description |
|---|---|
A namespace import is part of a VTCL file; it makes typing of model elements easier since the elements of the model subtree determined by the namespace can be referenced relative to the namespace when using them as types. |
![]() | Syntax |
|---|---|
NamespaceImportsAST ::= $empty
| NamespaceImportsAST NamespaceImportAST
NamespaceImportAST ::= import QualifiedTypeNameAST ;
Namespaces are identified by qualified model element names. Import instructions must be placed at the beginning of the file. |
![]() | Constraints |
|---|---|
Only an entity identifies a namespace in the model space, i.e. the qualified model element name of the import cannot be the name of a relation. |
Example 2.1. Sample namespace import
// All elements below the entity uml2.metamodel will become available as types
import uml2.metamodel;
// Now the type uml2.metamodel.Classifier of C can be shortened
pattern myPattern(C) = {
Classifier(C);
}