blob: 2a10e3278a68f8a83feb7cc309c1209b3f733428 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2018 Willink Transformations and others.
* 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:
* Adolfo Sanchez-Barbudo Herrera - initial API and implementation
*******************************************************************************/
/*
* generated by Xtext 2.10.0
*/
package org.eclipse.qvtd.doc.generator;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.xtext.generator.AbstractGenerator;
import org.eclipse.xtext.generator.IFileSystemAccess2;
import org.eclipse.xtext.generator.IGeneratorContext;
/**
* Generates code from your model files on save.
*
* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation
*/
public class MiniOCLCSGenerator extends AbstractGenerator {
@Override
public void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
// Iterator<Greeting> filtered = Iterators.filter(resource.getAllContents(), Greeting.class);
// Iterator<String> names = Iterators.transform(filtered, new Function<Greeting, String>() {
//
// @Override
// public String apply(Greeting greeting) {
// return greeting.getName();
// }
// });
// fsa.generateFile("greetings.txt", "People to greet: " + IteratorExtensions.join(names, ", "));
}
}