blob: cc31732a27e2d801bff987fe79d5c7260837f559 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2016, 2019 Willink Transformations and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* E.D.Willink - initial API and implementation
******************************************************************************/
package org.eclipse.qvtd.pivot.qvtrelation.utilities;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.ocl.pivot.OCLExpression;
import org.eclipse.ocl.pivot.Type;
import org.eclipse.ocl.pivot.internal.manager.FlowAnalysis;
import org.eclipse.ocl.pivot.internal.manager.TemplateParameterSubstitutionVisitor;
import org.eclipse.ocl.pivot.resource.ProjectManager;
import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbaseEnvironmentFactory;
import org.eclipse.qvtd.runtime.model.QVTruntimeLibrary;
public class QVTrEnvironmentFactory extends QVTbaseEnvironmentFactory
{
private static class QVTrCreateStrategy extends CreateStrategy
{
@Override
public @NonNull TemplateParameterSubstitutionVisitor createTemplateParameterSubstitutionVisitor(
@NonNull QVTbaseEnvironmentFactory environmentFactory, @Nullable Type selfType, @Nullable Type selfTypeValue) {
return new QVTrelationTemplateParameterSubstitutionVisitor(environmentFactory, selfType, selfTypeValue);
}
}
public static final @NonNull CreateStrategy CREATE_STRATEGY = new QVTrCreateStrategy();
public QVTrEnvironmentFactory(@NonNull ProjectManager projectMap, @Nullable ResourceSet externalResourceSet) {
super(projectMap, externalResourceSet, CREATE_STRATEGY);
getStandardLibrary().setDefaultStandardLibraryURI(QVTruntimeLibrary.STDLIB_URI);
}
@Override
public @NonNull FlowAnalysis createFlowAnalysis(@NonNull OCLExpression contextExpression) {
return new QVTrelationFlowAnalysis(this, contextExpression);
}
public boolean keepDebug() {
return false;
}
}