aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/language/src/main/java/tools/refinery/language/ProblemRuntimeModule.java
blob: f9a564b0d15fe0df20b2ad91be55fcd0a71b5829 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
 * SPDX-FileCopyrightText: 2021-2024 The Refinery Authors <https://refinery.tools/>
 *
 * SPDX-License-Identifier: EPL-2.0
 */

/*
 * generated by Xtext 2.25.0
 */
package tools.refinery.language;

import com.google.inject.Binder;
import com.google.inject.name.Names;
import org.eclipse.xtext.conversion.IValueConverterService;
import org.eclipse.xtext.linking.ILinkingService;
import org.eclipse.xtext.naming.IQualifiedNameConverter;
import org.eclipse.xtext.naming.IQualifiedNameProvider;
import org.eclipse.xtext.parser.IAstFactory;
import org.eclipse.xtext.parser.IParser;
import org.eclipse.xtext.parsetree.reconstr.ITransientValueService;
import org.eclipse.xtext.resource.*;
import org.eclipse.xtext.scoping.IGlobalScopeProvider;
import org.eclipse.xtext.scoping.IScopeProvider;
import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider;
import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer;
import org.eclipse.xtext.serializer.tokens.ICrossReferenceSerializer;
import org.eclipse.xtext.validation.IDiagnosticConverter;
import org.eclipse.xtext.validation.IResourceValidator;
import org.eclipse.xtext.xbase.annotations.validation.DerivedStateAwareResourceValidator;
import tools.refinery.language.conversion.ProblemValueConverterService;
import tools.refinery.language.linking.ProblemLinkingService;
import tools.refinery.language.naming.ProblemDelegateQualifiedNameProvider;
import tools.refinery.language.naming.ProblemQualifiedNameConverter;
import tools.refinery.language.naming.ProblemQualifiedNameProvider;
import tools.refinery.language.parser.ProblemEcoreElementFactory;
import tools.refinery.language.parser.antlr.TokenSourceInjectingProblemParser;
import tools.refinery.language.resource.ProblemLocationInFileProvider;
import tools.refinery.language.resource.ProblemResource;
import tools.refinery.language.resource.ProblemResourceDescriptionManager;
import tools.refinery.language.resource.ProblemResourceDescriptionStrategy;
import tools.refinery.language.resource.state.ProblemDerivedStateComputer;
import tools.refinery.language.scoping.ProblemGlobalScopeProvider;
import tools.refinery.language.scoping.ProblemLocalScopeProvider;
import tools.refinery.language.serializer.PreferShortAssertionsProblemSemanticSequencer;
import tools.refinery.language.serializer.ProblemCrossReferenceSerializer;
import tools.refinery.language.serializer.ProblemTransientValueService;
import tools.refinery.language.validation.ProblemDiagnosticConverter;

/**
 * Use this class to register components to be used at runtime / without the
 * Equinox extension registry.
 */
// Unused methods in this class are called by reflection to configure the Xtext Injector.
@SuppressWarnings("unused")
public class ProblemRuntimeModule extends AbstractProblemRuntimeModule {
	@Override
	public Class<? extends IParser> bindIParser() {
		return TokenSourceInjectingProblemParser.class;
	}

	@Override
	public Class<? extends IAstFactory> bindIAstFactory() {
		return ProblemEcoreElementFactory.class;
	}

	public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() {
		return ProblemQualifiedNameConverter.class;
	}

	public void configureIQualifiedNameProviderDelegate(Binder binder) {
		binder.bind(IQualifiedNameProvider.class)
				.annotatedWith(Names.named(ProblemQualifiedNameProvider.NAMED_DELEGATE))
				.to(ProblemDelegateQualifiedNameProvider.class);
	}

	@Override
	public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
		return ProblemQualifiedNameProvider.class;
	}

	public Class<? extends IDefaultResourceDescriptionStrategy> bindIDefaultResourceDescriptionStrategy() {
		return ProblemResourceDescriptionStrategy.class;
	}

	@Override
	public Class<? extends IValueConverterService> bindIValueConverterService() {
		return ProblemValueConverterService.class;
	}

	@Override
	public Class<? extends ILinkingService> bindILinkingService() {
		return ProblemLinkingService.class;
	}

	@Override
	public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() {
		return ProblemGlobalScopeProvider.class;
	}

	@Override
	public void configureIScopeProviderDelegate(Binder binder) {
		binder.bind(IScopeProvider.class).annotatedWith(Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE))
				.to(ProblemLocalScopeProvider.class);
	}

	@Override
	public Class<? extends XtextResource> bindXtextResource() {
		return ProblemResource.class;
	}

	// Method name follows Xtext convention.
	@SuppressWarnings("squid:S100")
	public Class<? extends IResourceDescription.Manager> bindIResourceDescription$Manager() {
		return ProblemResourceDescriptionManager.class;
	}

	public Class<? extends IResourceValidator> bindIResourceValidator() {
		return DerivedStateAwareResourceValidator.class;
	}

	public Class<? extends IDerivedStateComputer> bindIDerivedStateComputer() {
		return ProblemDerivedStateComputer.class;
	}

	@Override
	public Class<? extends ILocationInFileProvider> bindILocationInFileProvider() {
		return ProblemLocationInFileProvider.class;
	}

	@Override
	public Class<? extends ITransientValueService> bindITransientValueService() {
		return ProblemTransientValueService.class;
	}

	@Override
	public Class<? extends ISemanticSequencer> bindISemanticSequencer() {
		return PreferShortAssertionsProblemSemanticSequencer.class;
	}

	public Class<? extends ICrossReferenceSerializer> bindICrossReferenceSerializer() {
		return ProblemCrossReferenceSerializer.class;
	}

	public Class<? extends IDiagnosticConverter> bindIDiagnosticConverter() {
		return ProblemDiagnosticConverter.class;
	}
}