diff options
author | 2019-02-17 19:34:52 +0100 | |
---|---|---|
committer | 2019-02-17 19:34:52 +0100 | |
commit | cb77845089f6c8171fc3c39a92690dee3671886a (patch) | |
tree | ea37e44ec4f2a3a55b01227813e2c23190aa1a60 /Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/StandaloneScriptExecutor.xtend | |
parent | Solution store diversity requirement set to 1 as default (diff) | |
download | VIATRA-Generator-cb77845089f6c8171fc3c39a92690dee3671886a.tar.gz VIATRA-Generator-cb77845089f6c8171fc3c39a92690dee3671886a.tar.zst VIATRA-Generator-cb77845089f6c8171fc3c39a92690dee3671886a.zip |
Created new module to load referred patterns. hacked metamodel linking.
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/StandaloneScriptExecutor.xtend')
-rw-r--r-- | Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/StandaloneScriptExecutor.xtend | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/StandaloneScriptExecutor.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/StandaloneScriptExecutor.xtend index f373d910..c612f0ea 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/StandaloneScriptExecutor.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/StandaloneScriptExecutor.xtend | |||
@@ -17,6 +17,11 @@ import org.eclipse.viatra.query.runtime.api.ViatraQueryEngineOptions | |||
17 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint | 17 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint |
18 | import org.eclipse.viatra.query.runtime.rete.util.ReteHintOptions | 18 | import org.eclipse.viatra.query.runtime.rete.util.ReteHintOptions |
19 | import org.eclipse.viatra.query.runtime.rete.matcher.ReteEngine | 19 | import org.eclipse.viatra.query.runtime.rete.matcher.ReteEngine |
20 | import org.eclipse.viatra.query.patternlanguage.emf.EMFPatternLanguageStandaloneCompilerSetup | ||
21 | import org.eclipse.viatra.query.patternlanguage.emf.EMFPatternLanguageStandaloneSetupGenerated | ||
22 | import org.eclipse.xtext.resource.XtextResourceSet | ||
23 | import com.google.inject.Injector | ||
24 | import com.google.inject.Guice | ||
20 | 25 | ||
21 | class StandaloneScriptExecutor { | 26 | class StandaloneScriptExecutor { |
22 | def static void main(String[] args) { | 27 | def static void main(String[] args) { |
@@ -32,9 +37,19 @@ class StandaloneScriptExecutor { | |||
32 | } | 37 | } |
33 | } | 38 | } |
34 | 39 | ||
40 | static def protected Injector internalCreateInjector() { | ||
41 | var newInjector = new EMFPatternLanguageStandaloneSetup().createInjectorAndDoEMFRegistration(); | ||
42 | val PatternLanguageWithRSModule module = new PatternLanguageWithRSModule | ||
43 | newInjector = Guice.createInjector(module) | ||
44 | //val XtextInjectorProvider x = null | ||
45 | return newInjector; | ||
46 | } | ||
47 | |||
48 | |||
35 | def static loadScript(String path) { | 49 | def static loadScript(String path) { |
36 | //Initialise extensions | 50 | //Initialise extensions |
37 | EMFPatternLanguageStandaloneSetup.doSetup | 51 | val i = (new PatternLanguageWithRSSetup).createInjectorAndDoEMFRegistration |
52 | //PatternLanguageWithRSSetup.createInjectorAndDoEMFRegistration | ||
38 | ApplicationConfigurationStandaloneSetup.doSetup | 53 | ApplicationConfigurationStandaloneSetup.doSetup |
39 | Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put("xmi",new XMIResourceFactoryImpl) | 54 | Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put("xmi",new XMIResourceFactoryImpl) |
40 | Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put("logicproblem",new XMIResourceFactoryImpl) | 55 | Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put("logicproblem",new XMIResourceFactoryImpl) |
@@ -43,7 +58,9 @@ class StandaloneScriptExecutor { | |||
43 | 58 | ||
44 | val ext = path.split("\\.").last | 59 | val ext = path.split("\\.").last |
45 | if(ext.equals("vsconfig")) { | 60 | if(ext.equals("vsconfig")) { |
46 | val resourceSet = new ResourceSetImpl | 61 | |
62 | val resourceSet = //new ResourceSetImpl | ||
63 | i.getInstance(XtextResourceSet); | ||
47 | var Resource resource | 64 | var Resource resource |
48 | 65 | ||
49 | try{ | 66 | try{ |