| 1 | /* |
|---|
| 2 | * generated by Xtext |
|---|
| 3 | */ |
|---|
| 4 | package de.ugoe.cs.swe.bnftools; |
|---|
| 5 | |
|---|
| 6 | import org.eclipse.emf.ecore.EPackage; |
|---|
| 7 | import org.eclipse.xtext.ISetup; |
|---|
| 8 | import org.eclipse.emf.ecore.resource.Resource; |
|---|
| 9 | |
|---|
| 10 | import com.google.inject.Guice; |
|---|
| 11 | import com.google.inject.Injector; |
|---|
| 12 | |
|---|
| 13 | /** |
|---|
| 14 | * Generated from StandaloneSetup.xpt! |
|---|
| 15 | */ |
|---|
| 16 | @SuppressWarnings("all") |
|---|
| 17 | public class EbnfStandaloneSetupGenerated implements ISetup { |
|---|
| 18 | |
|---|
| 19 | public Injector createInjectorAndDoEMFRegistration() { |
|---|
| 20 | // register default ePackages |
|---|
| 21 | if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("ecore")) |
|---|
| 22 | Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put( |
|---|
| 23 | "ecore", new org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl()); |
|---|
| 24 | if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xmi")) |
|---|
| 25 | Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put( |
|---|
| 26 | "xmi", new org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl()); |
|---|
| 27 | if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xtextbin")) |
|---|
| 28 | Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put( |
|---|
| 29 | "xtextbin", new org.eclipse.xtext.resource.impl.BinaryGrammarResourceFactoryImpl()); |
|---|
| 30 | if (!EPackage.Registry.INSTANCE.containsKey(org.eclipse.xtext.XtextPackage.eNS_URI)) |
|---|
| 31 | EPackage.Registry.INSTANCE.put(org.eclipse.xtext.XtextPackage.eNS_URI, org.eclipse.xtext.XtextPackage.eINSTANCE); |
|---|
| 32 | |
|---|
| 33 | Injector injector = createInjector(); |
|---|
| 34 | register(injector); |
|---|
| 35 | return injector; |
|---|
| 36 | } |
|---|
| 37 | |
|---|
| 38 | public Injector createInjector() { |
|---|
| 39 | return Guice.createInjector(new de.ugoe.cs.swe.bnftools.EbnfRuntimeModule()); |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 42 | public void register(Injector injector) { |
|---|
| 43 | if (!EPackage.Registry.INSTANCE.containsKey("http://www.ugoe.de/cs/swe/bnftools/Ebnf")) { |
|---|
| 44 | EPackage.Registry.INSTANCE.put("http://www.ugoe.de/cs/swe/bnftools/Ebnf", de.ugoe.cs.swe.bnftools.ebnf.EbnfPackage.eINSTANCE); |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | org.eclipse.xtext.resource.IResourceFactory resourceFactory = injector.getInstance(org.eclipse.xtext.resource.IResourceFactory.class); |
|---|
| 48 | org.eclipse.xtext.resource.IResourceServiceProvider serviceProvider = injector.getInstance(org.eclipse.xtext.resource.IResourceServiceProvider.class); |
|---|
| 49 | Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bnf", resourceFactory); |
|---|
| 50 | org.eclipse.xtext.resource.IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("bnf", serviceProvider); |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | } |
|---|
| 55 | } |
|---|