diff options
Diffstat (limited to 'Solvers/VIATRA-Solver')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/util/ParseUtil.xtend | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/util/ParseUtil.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/util/ParseUtil.xtend index 26ec7091..69b54b8a 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/util/ParseUtil.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/util/ParseUtil.xtend | |||
@@ -6,7 +6,6 @@ import com.google.inject.Inject | |||
6 | import com.google.inject.Injector | 6 | import com.google.inject.Injector |
7 | import com.google.inject.multibindings.Multibinder | 7 | import com.google.inject.multibindings.Multibinder |
8 | import com.google.inject.name.Names | 8 | import com.google.inject.name.Names |
9 | import com.google.inject.util.Modules | ||
10 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.LogiclanguagePackage | 9 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.LogiclanguagePackage |
11 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicproblemPackage | 10 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicproblemPackage |
12 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialinterpretationPackage | 11 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialinterpretationPackage |
@@ -46,7 +45,6 @@ import org.eclipse.xtext.scoping.IScope | |||
46 | import org.eclipse.xtext.scoping.IScopeProvider | 45 | import org.eclipse.xtext.scoping.IScopeProvider |
47 | import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider | 46 | import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider |
48 | import org.eclipse.xtext.scoping.impl.SimpleScope | 47 | import org.eclipse.xtext.scoping.impl.SimpleScope |
49 | import org.eclipse.xtext.service.AbstractGenericModule | ||
50 | import org.eclipse.xtext.service.SingletonBinding | 48 | import org.eclipse.xtext.service.SingletonBinding |
51 | import org.eclipse.xtext.workspace.IProjectConfigProvider | 49 | import org.eclipse.xtext.workspace.IProjectConfigProvider |
52 | 50 | ||
@@ -65,35 +63,32 @@ package class StandaloneParserWithFixedMetamodelProviderModule extends Standalon | |||
65 | Multibinder::newSetBinder(binder, IMetamodelProviderInstance); | 63 | Multibinder::newSetBinder(binder, IMetamodelProviderInstance); |
66 | } | 64 | } |
67 | 65 | ||
68 | } | 66 | @SingletonBinding |
69 | 67 | override IResourceServiceProvider.Registry bindIResourceServiceProvider$Registry() { | |
70 | package class StandaloneParserOverridesModule extends AbstractGenericModule { | 68 | new VqlDeactivatedServiceProviderRegistry |
71 | 69 | } | |
72 | def Class<? extends IMetamodelProvider> bindIMetamodelProvider() { | 70 | |
71 | override Class<? extends IMetamodelProvider> bindIMetamodelProvider() { | ||
73 | FixedMetamodelProvider | 72 | FixedMetamodelProvider |
74 | } | 73 | } |
75 | 74 | ||
76 | def Class<? extends IProjectConfigProvider> bindProjectConfigProvider() { | 75 | override Class<? extends IProjectConfigProvider> bindProjectConfigProvider() { |
77 | NullProjectConfigProvider | 76 | NullProjectConfigProvider |
78 | } | 77 | } |
79 | 78 | ||
80 | @SingletonBinding | 79 | @SingletonBinding |
81 | def Class<? extends IResourceServiceProvider.Registry> bindIResourceServiceProvider$Registry() { | 80 | override EValidator.Registry bindEValidatorRegistry() { |
82 | VqlDeactivatedServiceProviderRegistry | ||
83 | } | ||
84 | |||
85 | def EValidator.Registry bindEValidator$Registry() { | ||
86 | // org.eclipse.xtext.validation.EValidatorRegistrar modifies EValidators already in the registry, | 81 | // org.eclipse.xtext.validation.EValidatorRegistrar modifies EValidators already in the registry, |
87 | // so it is not safe to populate the registry from the EValidator.Registry.INSTANCE singleton. | 82 | // so it is not safe to populate the registry from the EValidator.Registry.INSTANCE singleton. |
88 | // There is no need to execute any EValiator other than EMFPatternLanguageValidator, | 83 | // There is no need to execute any EValiator other than EMFPatternLanguageValidator, |
89 | // so we can start with a blank registry instead. | 84 | // so we can start with a blank registry instead. |
90 | new EValidatorRegistryImpl() | 85 | new EValidatorRegistryImpl |
91 | } | 86 | } |
92 | 87 | ||
93 | def EPackage.Registry bindEPackage$Registry() { | 88 | @SingletonBinding |
89 | override EPackage.Registry bindEPackageRegistry() { | ||
94 | new EPackageRegistryImpl(EPackage.Registry.INSTANCE) | 90 | new EPackageRegistryImpl(EPackage.Registry.INSTANCE) |
95 | } | 91 | } |
96 | |||
97 | } | 92 | } |
98 | 93 | ||
99 | package class NullProjectConfigProvider implements IProjectConfigProvider { | 94 | package class NullProjectConfigProvider implements IProjectConfigProvider { |
@@ -136,10 +131,8 @@ class ParseUtil { | |||
136 | 131 | ||
137 | def protected Injector internalCreateInjector() { | 132 | def protected Injector internalCreateInjector() { |
138 | ensureViatraInitialized(); | 133 | ensureViatraInitialized(); |
139 | val runtimeModulemodule = new StandaloneParserWithFixedMetamodelProviderModule | 134 | val runtimeModule = new StandaloneParserWithFixedMetamodelProviderModule |
140 | val overridesModule = new StandaloneParserOverridesModule | 135 | val newInjector = Guice.createInjector(runtimeModule) |
141 | val module = Modules.override(runtimeModulemodule).with(overridesModule) | ||
142 | val newInjector = Guice.createInjector(module) | ||
143 | return newInjector | 136 | return newInjector |
144 | } | 137 | } |
145 | 138 | ||