blob: e6358f186898c195c2099b172cc3f569c9635c5b [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2016, 2021 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.acceleo.aql;
import org.eclipse.acceleo.aql.evaluation.GenerationResult;
import org.eclipse.acceleo.query.runtime.namespace.IQualifiedNameQueryEnvironment;
/**
* This environment will keep track of Acceleo's evaluation context. TODO doc.
*
* @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
*/
public class AcceleoEnvironment implements IAcceleoEnvironment {
/** The AQL environment that will be used to evaluate aql expressions from this Acceleo context. */
private IQualifiedNameQueryEnvironment aqlEnvironment;
/**
* The {@link GenerationResult}.
*/
private final GenerationResult generationResult = new GenerationResult();
/**
* Constructor.
*
* @param aqlEnvironment
* the {@link IQualifiedNameQueryEnvironment}
*/
public AcceleoEnvironment(IQualifiedNameQueryEnvironment aqlEnvironment) {
this.aqlEnvironment = aqlEnvironment;
/* FIXME we need a cross reference provider, and we need to make it configurable */
org.eclipse.acceleo.query.runtime.Query.configureEnvironment(aqlEnvironment, null, null);
}
@Override
public IQualifiedNameQueryEnvironment getQueryEnvironment() {
return aqlEnvironment;
}
@Override
public GenerationResult getGenerationResult() {
return generationResult;
}
}