blob: 6b50f13ca0fd63ce8d89d82b20b580f87f911ad8 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2008 The University of York.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Contributors:
* Dimitrios Kolovos - initial API and implementation
******************************************************************************/
package org.eclipse.epsilon.examples.standalone.egl;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.epsilon.egl.EglFileGeneratingTemplateFactory;
import org.eclipse.epsilon.egl.EgxModule;
import org.eclipse.epsilon.eol.IEolModule;
import org.eclipse.epsilon.eol.models.IModel;
import org.eclipse.epsilon.examples.standalone.EpsilonStandaloneExample;
/**
* This example demonstrates using the
* Epsilon Generation Language, the M2T language
* of Epsilon, in a stand-alone manner
* @author Dimitrios Kolovos
*/
public class EgxStandaloneExample extends EpsilonStandaloneExample {
public static void main(String[] args) throws Exception {
new EgxStandaloneExample().execute();
}
@Override
public IEolModule createModule() {
try {
EglFileGeneratingTemplateFactory templateFactory = new EglFileGeneratingTemplateFactory();
templateFactory.setOutputRoot(new File("egx-gen").getAbsolutePath());
return new EgxModule(templateFactory);
}
catch (Exception ex) {
throw new RuntimeException(ex);
}
}
@Override
public List<IModel> getModels() throws Exception {
List<IModel> models = new ArrayList<IModel>();
models.add(createEmfModel("Model", "models/Tree.xmi", "models/Tree.ecore", true, false));
return models;
}
@Override
public String getSource() throws Exception {
return "egl/demo.egx";
}
}