/alpha/com.ironglass.hdlforge/src-gen/com/ironglass/hdlforge/SystemVerilogStandaloneSetupGenerated.java

http://hdl-forge.googlecode.com/ · Java · 44 lines · 27 code · 14 blank · 3 comment · 1 complexity · 72935e3fd99ce37014b7cd856dc2c0c5 MD5 · raw file

  1. package com.ironglass.hdlforge;
  2. import org.eclipse.emf.ecore.EPackage;
  3. import org.eclipse.xtext.ISetup;
  4. import org.eclipse.emf.ecore.resource.Resource;
  5. import com.google.inject.Guice;
  6. import com.google.inject.Injector;
  7. /**
  8. * Generated from StandaloneSetup.xpt!
  9. */
  10. @SuppressWarnings("all")
  11. public class SystemVerilogStandaloneSetupGenerated implements ISetup {
  12. public Injector createInjectorAndDoEMFRegistration() {
  13. org.eclipse.xtext.common.TerminalsStandaloneSetup.doSetup();
  14. Injector injector = createInjector();
  15. register(injector);
  16. return injector;
  17. }
  18. public Injector createInjector() {
  19. return Guice.createInjector(new com.ironglass.hdlforge.SystemVerilogRuntimeModule());
  20. }
  21. public void register(Injector injector) {
  22. if (!EPackage.Registry.INSTANCE.containsKey("http://www.ironglass.com/hdlforge/SystemVerilog")) {
  23. EPackage.Registry.INSTANCE.put("http://www.ironglass.com/hdlforge/SystemVerilog", com.ironglass.hdlforge.systemVerilog.SystemVerilogPackage.eINSTANCE);
  24. }
  25. org.eclipse.xtext.resource.IResourceFactory resourceFactory = injector.getInstance(org.eclipse.xtext.resource.IResourceFactory.class);
  26. org.eclipse.xtext.resource.IResourceServiceProvider serviceProvider = injector.getInstance(org.eclipse.xtext.resource.IResourceServiceProvider.class);
  27. Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("sv", resourceFactory);
  28. org.eclipse.xtext.resource.IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("sv", serviceProvider);
  29. }
  30. }