aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/language/src/main/java/tools/refinery/language/ProblemRuntimeModule.java
blob: 00dd3de384ec2042d33f6840232454ada0bcfd02 (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
/*
 * SPDX-FileCopyrightText: 2021-2023 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.parser.IParser;
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.ProblemQualifiedNameConverter;
import tools.refinery.language.parser.antlr.TokenSourceInjectingProblemParser;
import tools.refinery.language.resource.ProblemDerivedStateComputer;
import tools.refinery.language.resource.ProblemLocationInFileProvider;
import tools.refinery.language.resource.ProblemResource;
import tools.refinery.language.resource.ProblemResourceDescriptionStrategy;
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.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;
	}

	public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() {
		return ProblemQualifiedNameConverter.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 DerivedStateAwareResourceDescriptionManager.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 ISemanticSequencer> bindISemanticSequencer() {
		return PreferShortAssertionsProblemSemanticSequencer.class;
	}

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

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