org.eclipse.xtext.linking.ILinker Java Examples

The following examples show how to use org.eclipse.xtext.linking.ILinker. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FragmentsEagerLinkingInjectorProvider.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected Injector internalCreateInjector() {
	return new FragmentTestLanguageStandaloneSetup() {
		@Override
		public Injector createInjector() {
			return Guice.createInjector(new FragmentTestLanguageRuntimeModule() {
				@Override
				public Class<? extends XtextResource> bindXtextResource() {
					return XtextResource.class;
				}
				@Override
				public Class<? extends ILinker> bindILinker() {
					return Linker.class;
				}
			});
		}
	}.createInjectorAndDoEMFRegistration();
}
 
Example #2
Source File: RuntimeInjectorProviderWithResourceUpdates.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected Injector internalCreateInjector() {
	return new RuntimeTestSetup() {
		@Override
		public Injector createInjector() {
			return Guice.createInjector(new XtendRuntimeTestModule() {
				@Override
				public Class<? extends ILinker> bindILinker() {
					return LinkerWithResourceUpdates.class;
				}
			});
		}
	}.createInjectorAndDoEMFRegistration();
}
 
Example #3
Source File: Xtext2EcoreTransformerTest.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public XtextResource doGetResource(final InputStream in, final URI uri) throws Exception {
  XtextResourceSet rs = this.<XtextResourceSet>get(XtextResourceSet.class);
  rs.setClasspathURIContext(this.getClass());
  Resource _createResource = this.getResourceFactory().createResource(uri);
  final XtextResource resource = ((XtextResource) _createResource);
  rs.getResources().add(resource);
  XtextLinker linker = new XtextLinker() {
    @Override
    protected Xtext2EcoreTransformer createTransformer(final Grammar grammar, final IDiagnosticConsumer consumer) {
      Xtext2EcoreTransformer result = super.createTransformer(grammar, consumer);
      ErrorAcceptor _errorAcceptor = result.getErrorAcceptor();
      Xtext2EcoreTransformerTest.MyErrorAcceptor _myErrorAcceptor = new Xtext2EcoreTransformerTest.MyErrorAcceptor(_errorAcceptor, Xtext2EcoreTransformerTest.this.errorAcceptorMock);
      result.setErrorAcceptor(_myErrorAcceptor);
      return result;
    }
  };
  ILinker _linker = resource.getLinker();
  linker.setScopeProvider(((XtextLinker) _linker).getScopeProvider());
  ILinker _linker_1 = resource.getLinker();
  linker.setLinkingService(((Linker) _linker_1).getLinkingService());
  ILinker _linker_2 = resource.getLinker();
  linker.setLinkingHelper(((Linker) _linker_2).getLinkingHelper());
  XtextLinker.PackageRemover _packageRemover = new XtextLinker.PackageRemover();
  linker.setPackageRemover(_packageRemover);
  LinkingDiagnosticMessageProvider _linkingDiagnosticMessageProvider = new LinkingDiagnosticMessageProvider();
  linker.setDiagnosticMessageProvider(_linkingDiagnosticMessageProvider);
  OnChangeEvictingCache _onChangeEvictingCache = new OnChangeEvictingCache();
  linker.setCache(_onChangeEvictingCache);
  resource.setLinker(linker);
  resource.load(in, null);
  return resource;
}
 
Example #4
Source File: DefaultXbaseRuntimeModule.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Class<? extends ILinker> bindILinker() {
	return XbaseLazyLinker.class;
}
 
Example #5
Source File: XtendUiModule.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ILinker> bindILinker() {
	return Linker.class;
}
 
Example #6
Source File: XtendRuntimeModule.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Class<? extends ILinker> bindILinker() {
	return RuntimeLinker.class;
}
 
Example #7
Source File: XtextResource.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public ILinker getLinker() {
	return linker;
}
 
Example #8
Source File: XtextResource.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public void setLinker(ILinker linker) {
	this.linker = linker;
}
 
Example #9
Source File: XtextRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Class<? extends ILinker> bindILinker() {
	return org.eclipse.xtext.xtext.XtextLinker.class;
}
 
Example #10
Source File: XtextTerminalsTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Class<? extends ILinker> bindILinker() {
	return XtextLinker.class;
}
 
Example #11
Source File: SequencerTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Class<? extends ILinker> bindILinker() {
	return NullSettingLazyLinker.class;
}
 
Example #12
Source File: SGenTestRuntimeModule.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public Class<? extends ILinker> bindILinker() {
	return Linker.class;
}
 
Example #13
Source File: AbstractSARLRuntimeModule.java    From sarl with Apache License 2.0 4 votes vote down vote up
public Class<? extends ILinker> bindILinker() {
	return RuntimeLinker.class;
}
 
Example #14
Source File: N4JSRuntimeModule.java    From n4js with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Customized linker, that produces a linked AST with customized encoded URIs. It also triggers the validation of
 * the so produced linked AST.
 *
 * @return Class<{@link N4JSLinker}>
 */
@Override
public Class<? extends ILinker> bindILinker() {
	return N4JSLinker.class;
}