projet-mini-genie-logiciel-.../eclipse-workspace/fr.n7.simplepdl.txt.pdl/src-gen/fr/n7/simplepdl/txt/PDLStandaloneSetupGenerated.java
Laurent Fainsin de42fac315 TP7
2021-10-12 18:49:13 +02:00

38 lines
1.2 KiB
Java

/*
* generated by Xtext 2.23.0
*/
package fr.n7.simplepdl.txt;
import com.google.inject.Guice;
import com.google.inject.Injector;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.xtext.ISetup;
import org.eclipse.xtext.common.TerminalsStandaloneSetup;
import org.eclipse.xtext.resource.IResourceFactory;
import org.eclipse.xtext.resource.IResourceServiceProvider;
@SuppressWarnings("all")
public class PDLStandaloneSetupGenerated implements ISetup {
@Override
public Injector createInjectorAndDoEMFRegistration() {
TerminalsStandaloneSetup.doSetup();
Injector injector = createInjector();
register(injector);
return injector;
}
public Injector createInjector() {
return Guice.createInjector(new PDLRuntimeModule());
}
public void register(Injector injector) {
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("pdl", resourceFactory);
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("pdl", serviceProvider);
}
}