1 | /* |
---|
2 | * generated by Xtext |
---|
3 | */ |
---|
4 | package com.framsticks.framclipse; |
---|
5 | |
---|
6 | import org.eclipse.xtext.conversion.IValueConverterService; |
---|
7 | import org.eclipse.xtext.resource.IResourceDescription; |
---|
8 | import org.eclipse.xtext.scoping.impl.ImportUriResolver; |
---|
9 | import org.eclipse.xtext.service.SingletonBinding; |
---|
10 | |
---|
11 | import com.framsticks.framclipse.resource.FramScriptResourceDescriptionManager; |
---|
12 | import com.framsticks.framclipse.scoping.FramScriptImportUriResolver; |
---|
13 | import com.framsticks.framclipse.script.ConstantProvider; |
---|
14 | import com.framsticks.framclipse.script.ExpressionTraverser; |
---|
15 | import com.framsticks.framclipse.script.XMLConstantProvider; |
---|
16 | import com.framsticks.framclipse.script.context.Framscontext; |
---|
17 | import com.framsticks.framclipse.script.model.Framscript; |
---|
18 | import com.google.inject.Binder; |
---|
19 | import com.thoughtworks.xstream.XStream; |
---|
20 | |
---|
21 | /** |
---|
22 | * Use this class to register components to be used at runtime / without the Equinox extension registry. |
---|
23 | */ |
---|
24 | public class FramScriptRuntimeModule extends com.framsticks.framclipse.AbstractFramScriptRuntimeModule { |
---|
25 | |
---|
26 | @SingletonBinding |
---|
27 | public Class<? extends ExpressionTraverser> bindExpressionTraverser() { |
---|
28 | return ExpressionTraverser.class; |
---|
29 | } |
---|
30 | |
---|
31 | @SingletonBinding |
---|
32 | public Class<? extends ConstantProvider> bindConstantProvider() { |
---|
33 | return XMLConstantProvider.class; |
---|
34 | } |
---|
35 | |
---|
36 | @SingletonBinding |
---|
37 | public XStream bindXStream() { |
---|
38 | XStream xstream = new XStream(); |
---|
39 | xstream.processAnnotations(Framscript.class); |
---|
40 | xstream.processAnnotations(Framscontext.class); |
---|
41 | return xstream; |
---|
42 | } |
---|
43 | |
---|
44 | @SingletonBinding |
---|
45 | public Class<? extends IResourceDescription.Manager> bindIResourceDescription$Manager() { |
---|
46 | return FramScriptResourceDescriptionManager.class; |
---|
47 | } |
---|
48 | |
---|
49 | @SingletonBinding |
---|
50 | public Class<? extends ImportUriResolver> bindImportUriResolver() { |
---|
51 | return FramScriptImportUriResolver.class; |
---|
52 | } |
---|
53 | |
---|
54 | @Override |
---|
55 | public Class<? extends IValueConverterService> bindIValueConverterService() { |
---|
56 | return FramScriptValueConverterService.class; |
---|
57 | } |
---|
58 | |
---|
59 | @Override |
---|
60 | public void configureRuntimeLexer(Binder binder) { |
---|
61 | binder.bind(org.eclipse.xtext.parser.antlr.Lexer.class) |
---|
62 | .annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME)) |
---|
63 | .to(FramScriptAuxiliaryLexer.class); |
---|
64 | } |
---|
65 | |
---|
66 | } |
---|