예제 #1
0
 public EMOF.IType ConstructTypeOfMethod(EnAr.Method method)
 {
     if (method.ReturnType == null)
     {
         return(null);
     }
     EnAr.Element returnType = explorer.repository.GetElementByGuid(method.ReturnType);
     if (returnType != null)
     {
         return(ConstructType(returnType));
     }
     else
     {
         return(ConstructPrimitiveType(method.ReturnType));
     }
 }
예제 #2
0
        private EMOF.IOperation ConstructOperation(EnAr.Method method)
        {
            //TODO type: is the classifierID the return type?
            EMOF.IOperation operation = new EMOF.Operation()
            {
                Name  = method.Name,
                Lower = 0,
                Upper = method.ReturnIsArray ? 1 : -1,
                // type = type
            };

            foreach (EnAr.Parameter enArParameter in method.Parameters)
            {
                EMOF.IParameter parameter = ConstructParameter(enArParameter);
                parameter.Operation = operation;
                operation.OwnedParameter.Add(parameter);
            }

            return(operation);
        }
예제 #3
0
        private QVTBase.Function ConstructFunction(QVTRelations.RelationalTransformation transformation, EnAr.Method method)
        {
            QVTBase.Function result = new QVTBase.Function()
            {
                Type               = emofImporter.ConstructTypeOfMethod(method),
                Name               = method.Name,
                Class              = transformation,
                IsOrdered          = false,
                IsUnique           = false,
                Lower              = 1,
                Upper              = 1,
                OwnedComment       = { },
                QueryExpression    = null,
                RaisedException    = { },
                ReferencedElements = { }, // TODO ???
            };

            foreach (EnAr.Parameter parameter in method.Parameters)
            {
                ConstructParameter(result, parameter);
            }

            return(result);
        }