diff options
author | 2020-06-25 19:55:10 +0200 | |
---|---|---|
committer | 2020-06-25 19:55:10 +0200 | |
commit | c3a6d4b9cf3657070d180aa65ddbf0459e880329 (patch) | |
tree | 780c4fc61578dcb309af53fb0c164c7627e51676 /Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/StandaloneScriptExecutor.xtend | |
parent | New configuration language parser WIP (diff) | |
parent | Scope unsat benchmarks (diff) | |
download | VIATRA-Generator-c3a6d4b9cf3657070d180aa65ddbf0459e880329.tar.gz VIATRA-Generator-c3a6d4b9cf3657070d180aa65ddbf0459e880329.tar.zst VIATRA-Generator-c3a6d4b9cf3657070d180aa65ddbf0459e880329.zip |
Merge branch 'kris'
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 | 40 |
1 files changed, 17 insertions, 23 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 c612f0ea..42be3ed7 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 | |||
@@ -1,27 +1,17 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.application.execution | 1 | package hu.bme.mit.inf.dslreasoner.application.execution |
2 | 2 | ||
3 | import com.google.inject.Guice | ||
4 | import com.google.inject.Injector | ||
3 | import hu.bme.mit.inf.dslreasoner.application.ApplicationConfigurationStandaloneSetup | 5 | import hu.bme.mit.inf.dslreasoner.application.ApplicationConfigurationStandaloneSetup |
4 | import org.eclipse.emf.common.util.URI | ||
5 | import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl | ||
6 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript | 6 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript |
7 | import org.eclipse.core.runtime.NullProgressMonitor | 7 | import org.eclipse.core.runtime.NullProgressMonitor |
8 | import org.eclipse.viatra.query.patternlanguage.emf.EMFPatternLanguageStandaloneSetup | 8 | import org.eclipse.emf.common.util.URI |
9 | import org.eclipse.emf.ecore.util.EcoreUtil | ||
10 | import java.io.FileNotFoundException | ||
11 | import org.eclipse.emf.ecore.resource.Resource | 9 | import org.eclipse.emf.ecore.resource.Resource |
12 | import java.io.IOException | 10 | import org.eclipse.emf.ecore.util.EcoreUtil |
13 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl | 11 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl |
14 | import org.eclipse.viatra.query.runtime.matchers.backend.IQueryBackendFactoryProvider | 12 | import org.eclipse.viatra.query.patternlanguage.emf.EMFPatternLanguageStandaloneSetup |
15 | import org.eclipse.viatra.query.runtime.rete.matcher.ReteBackendFactoryProvider | ||
16 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngineOptions | ||
17 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint | ||
18 | import org.eclipse.viatra.query.runtime.rete.util.ReteHintOptions | ||
19 | import org.eclipse.viatra.query.runtime.rete.matcher.ReteEngine | 13 | 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 | 14 | import org.eclipse.xtext.resource.XtextResourceSet |
23 | import com.google.inject.Injector | ||
24 | import com.google.inject.Guice | ||
25 | 15 | ||
26 | class StandaloneScriptExecutor { | 16 | class StandaloneScriptExecutor { |
27 | def static void main(String[] args) { | 17 | def static void main(String[] args) { |
@@ -81,11 +71,11 @@ class StandaloneScriptExecutor { | |||
81 | throw new IllegalArgumentException(message) | 71 | throw new IllegalArgumentException(message) |
82 | } | 72 | } |
83 | } else { | 73 | } else { |
84 | val message = ''' | 74 | val message = ''' |
85 | The Configuration Script contains «errors.size» error«IF errors.size>1»s«ENDIF»: | 75 | The Configuration Script contains «errors.size» error«IF errors.size>1»s«ENDIF»: |
86 | «FOR error : errors» | 76 | «FOR error : errors» |
87 | «"\t"»«error.message» | 77 | «"\t"»«error.message» |
88 | «ENDFOR» | 78 | «ENDFOR» |
89 | ''' | 79 | ''' |
90 | throw new IllegalArgumentException(message) | 80 | throw new IllegalArgumentException(message) |
91 | } | 81 | } |
@@ -94,8 +84,12 @@ class StandaloneScriptExecutor { | |||
94 | } | 84 | } |
95 | } | 85 | } |
96 | 86 | ||
97 | def static executeScript(String path){ | 87 | def static executeScript(String path) { |
98 | val executor = new ScriptExecutor | 88 | executeScript(path, StandardOutputBasedScriptConsole.FACTORY) |
89 | } | ||
90 | |||
91 | def static executeScript(String path, ScriptConsole.Factory scriptConsoleFactory){ | ||
92 | val executor = new ScriptExecutor(scriptConsoleFactory) | ||
99 | try{ | 93 | try{ |
100 | val content = loadScript(path) | 94 | val content = loadScript(path) |
101 | executor.executeScript(content,new NullProgressMonitor) | 95 | executor.executeScript(content,new NullProgressMonitor) |
@@ -104,4 +98,4 @@ class StandaloneScriptExecutor { | |||
104 | return e.message | 98 | return e.message |
105 | } | 99 | } |
106 | } | 100 | } |
107 | } \ No newline at end of file | 101 | } |