diff options
author | 2018-07-05 14:51:12 +0200 | |
---|---|---|
committer | 2018-07-05 14:51:12 +0200 | |
commit | 35d887b2b0a2fcaf480019f070bd6c58b325d23f (patch) | |
tree | 1ed8a0dbd26959b243e7afd997fa800d958b4f9d | |
parent | Fixing multiple true/false + bug preventing generation without PS (diff) | |
download | VIATRA-Generator-35d887b2b0a2fcaf480019f070bd6c58b325d23f.tar.gz VIATRA-Generator-35d887b2b0a2fcaf480019f070bd6c58b325d23f.tar.zst VIATRA-Generator-35d887b2b0a2fcaf480019f070bd6c58b325d23f.zip |
Added support for running application in plain java.
(However, I might added several unnecessary dependencies to the
visualisation package.)
9 files changed, 59 insertions, 20 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application.ui/src/hu/bme/mit/inf/dslreasoner/application/ui/execute/ExecuteScriptHandler.java b/Application/hu.bme.mit.inf.dslreasoner.application.ui/src/hu/bme/mit/inf/dslreasoner/application/ui/execute/ExecuteScriptHandler.java index ce1330bd..43d22ab3 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application.ui/src/hu/bme/mit/inf/dslreasoner/application/ui/execute/ExecuteScriptHandler.java +++ b/Application/hu.bme.mit.inf.dslreasoner.application.ui/src/hu/bme/mit/inf/dslreasoner/application/ui/execute/ExecuteScriptHandler.java | |||
@@ -40,6 +40,6 @@ public class ExecuteScriptHandler extends AbstractHandler implements IHandler { | |||
40 | } | 40 | } |
41 | } | 41 | } |
42 | return null; | 42 | return null; |
43 | } | 43 | } |
44 | 44 | ||
45 | } | 45 | } |
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/META-INF/MANIFEST.MF b/Application/hu.bme.mit.inf.dslreasoner.application/META-INF/MANIFEST.MF index 037dbf52..92b9840b 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/META-INF/MANIFEST.MF +++ b/Application/hu.bme.mit.inf.dslreasoner.application/META-INF/MANIFEST.MF | |||
@@ -31,7 +31,9 @@ Require-Bundle: org.eclipse.xtext, | |||
31 | org.eclipse.core.runtime;bundle-version="3.12.0", | 31 | org.eclipse.core.runtime;bundle-version="3.12.0", |
32 | org.eclipse.ui.console;bundle-version="3.6.201", | 32 | org.eclipse.ui.console;bundle-version="3.6.201", |
33 | org.eclipse.jface;bundle-version="3.12.2", | 33 | org.eclipse.jface;bundle-version="3.12.2", |
34 | org.eclipse.ui;bundle-version="3.108.1" | 34 | org.eclipse.ui;bundle-version="3.108.1", |
35 | org.eclipse.viatra.query.runtime.rete;bundle-version="2.0.0", | ||
36 | org.eclipse.viatra.query.runtime.localsearch;bundle-version="2.0.0" | ||
35 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | 37 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 |
36 | Export-Package: hu.bme.mit.inf.dslreasoner.application, | 38 | Export-Package: hu.bme.mit.inf.dslreasoner.application, |
37 | hu.bme.mit.inf.dslreasoner.application.applicationConfiguration, | 39 | hu.bme.mit.inf.dslreasoner.application.applicationConfiguration, |
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfigurationStandaloneSetup.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfigurationStandaloneSetup.xtend index ef07c9b3..1f9dc9db 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfigurationStandaloneSetup.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfigurationStandaloneSetup.xtend | |||
@@ -3,12 +3,17 @@ | |||
3 | */ | 3 | */ |
4 | package hu.bme.mit.inf.dslreasoner.application | 4 | package hu.bme.mit.inf.dslreasoner.application |
5 | 5 | ||
6 | import com.google.inject.Guice | ||
7 | import com.google.inject.Injector | ||
6 | 8 | ||
7 | /** | 9 | /** |
8 | * Initialization support for running Xtext languages without Equinox extension registry. | 10 | * Initialization support for running Xtext languages without Equinox extension registry. |
9 | */ | 11 | */ |
10 | class ApplicationConfigurationStandaloneSetup extends ApplicationConfigurationStandaloneSetupGenerated { | 12 | class ApplicationConfigurationStandaloneSetup extends ApplicationConfigurationStandaloneSetupGenerated { |
11 | 13 | ||
14 | override Injector createInjector() { | ||
15 | return Guice.createInjector(new ApplicationConfigurationStandaloneRuntimeModule()); | ||
16 | } | ||
12 | def static void doSetup() { | 17 | def static void doSetup() { |
13 | new ApplicationConfigurationStandaloneSetup().createInjectorAndDoEMFRegistration() | 18 | new ApplicationConfigurationStandaloneSetup().createInjectorAndDoEMFRegistration() |
14 | } | 19 | } |
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/GenerationTaskExecutor.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/GenerationTaskExecutor.xtend index 61526ce6..40ffaf28 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/GenerationTaskExecutor.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/GenerationTaskExecutor.xtend | |||
@@ -25,6 +25,7 @@ import java.util.Optional | |||
25 | import java.util.Scanner | 25 | import java.util.Scanner |
26 | import org.eclipse.core.runtime.IProgressMonitor | 26 | import org.eclipse.core.runtime.IProgressMonitor |
27 | import org.eclipse.emf.common.util.URI | 27 | import org.eclipse.emf.common.util.URI |
28 | import hu.bme.mit.inf.dslreasoner.workspace.URIBasedWorkspace | ||
28 | 29 | ||
29 | class GenerationTaskExecutor { | 30 | class GenerationTaskExecutor { |
30 | val metamodelLoader = new MetamodelLoader | 31 | val metamodelLoader = new MetamodelLoader |
@@ -69,13 +70,13 @@ class GenerationTaskExecutor { | |||
69 | 70 | ||
70 | try { | 71 | try { |
71 | val reasonerWorkspace = if(debugFolder!== null) { | 72 | val reasonerWorkspace = if(debugFolder!== null) { |
72 | new ProjectWorkspace(debugFolder.path,"") | 73 | new URIBasedWorkspace(debugFolder.path,"") |
73 | } else { | 74 | } else { |
74 | new NullWorkspace | 75 | new NullWorkspace |
75 | } | 76 | } |
76 | reasonerWorkspace.init | 77 | reasonerWorkspace.init |
77 | val outputWorkspace = if(outputFolder !== null) { | 78 | val outputWorkspace = if(outputFolder !== null) { |
78 | new ProjectWorkspace(outputFolder.path,"") | 79 | new URIBasedWorkspace(outputFolder.path,"") |
79 | } else { | 80 | } else { |
80 | new NullWorkspace | 81 | new NullWorkspace |
81 | } | 82 | } |
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptConsole.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptConsole.xtend index 1d8c473f..030d2b9e 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptConsole.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptConsole.xtend | |||
@@ -144,15 +144,19 @@ class ScriptConsole { | |||
144 | 144 | ||
145 | private def MessageConsole prepareRuntimeConsole() { | 145 | private def MessageConsole prepareRuntimeConsole() { |
146 | val plugin = ConsolePlugin.getDefault(); | 146 | val plugin = ConsolePlugin.getDefault(); |
147 | val conMan = plugin.getConsoleManager(); | 147 | if(plugin === null) { |
148 | val existingConsoles = conMan.getConsoles(); | 148 | return null |
149 | val existingConsolesWithID = existingConsoles.filter[it.name.equals(consoleID)] | ||
150 | if(existingConsolesWithID.empty) { | ||
151 | val MessageConsole res = new MessageConsole(consoleID,null) | ||
152 | conMan.addConsoles(#[res]); | ||
153 | return res | ||
154 | } else { | 149 | } else { |
155 | return existingConsolesWithID.head as MessageConsole | 150 | val conMan = plugin.getConsoleManager(); |
151 | val existingConsoles = conMan.getConsoles(); | ||
152 | val existingConsolesWithID = existingConsoles.filter[it.name.equals(consoleID)] | ||
153 | if(existingConsolesWithID.empty) { | ||
154 | val MessageConsole res = new MessageConsole(consoleID,null) | ||
155 | conMan.addConsoles(#[res]); | ||
156 | return res | ||
157 | } else { | ||
158 | return existingConsolesWithID.head as MessageConsole | ||
159 | } | ||
156 | } | 160 | } |
157 | } | 161 | } |
158 | 162 | ||
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptExecutor.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptExecutor.xtend index d8a37184..b9813040 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptExecutor.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptExecutor.xtend | |||
@@ -32,9 +32,6 @@ import org.eclipse.core.runtime.Status | |||
32 | 32 | ||
33 | class ScriptExecutor { | 33 | class ScriptExecutor { |
34 | val parser = new ApplicationConfigurationParser | 34 | val parser = new ApplicationConfigurationParser |
35 | def static void main(String[] args) { | ||
36 | println("generator") | ||
37 | } | ||
38 | 35 | ||
39 | /** | 36 | /** |
40 | * Executes a script | 37 | * Executes a script |
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicProblemBuilder.xtend b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicProblemBuilder.xtend index 652db34c..6fa1fcfd 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicProblemBuilder.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicProblemBuilder.xtend | |||
@@ -61,7 +61,8 @@ public class LogicProblemBuilder{ | |||
61 | val element = result.get(0); | 61 | val element = result.get(0); |
62 | if(element == "bool" || | 62 | if(element == "bool" || |
63 | element == "int" || | 63 | element == "int" || |
64 | element == "real") throw new LogicProblemBuilderException('''Reserved keyword "«element»"!''') | 64 | element == "real" || |
65 | element == "string") throw new LogicProblemBuilderException('''Reserved keyword "«element»"!''') | ||
65 | else return result.join(' ') | 66 | else return result.join(' ') |
66 | } | 67 | } |
67 | else return result.join(' ') | 68 | else return result.join(' ') |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/META-INF/MANIFEST.MF b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/META-INF/MANIFEST.MF index 18331278..699c9308 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/META-INF/MANIFEST.MF +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/META-INF/MANIFEST.MF | |||
@@ -12,8 +12,33 @@ Require-Bundle: com.google.guava, | |||
12 | hu.bme.mit.inf.dslreasoner.viatra2logic;bundle-version="1.0.0", | 12 | hu.bme.mit.inf.dslreasoner.viatra2logic;bundle-version="1.0.0", |
13 | hu.bme.mit.inf.dslreasoner.logic.model.validation;bundle-version="0.0.1", | 13 | hu.bme.mit.inf.dslreasoner.logic.model.validation;bundle-version="0.0.1", |
14 | org.eclipse.emf.ecore.xmi;bundle-version="2.12.0", | 14 | org.eclipse.emf.ecore.xmi;bundle-version="2.12.0", |
15 | guru.nidi.graphviz-java;bundle-version="0.2.1" | 15 | guru.nidi.graphviz-java;bundle-version="0.2.1";visibility:=reexport, |
16 | Import-Package: org.apache.log4j;version="1.2.15" | 16 | org.apache.batik.transcoder;bundle-version="1.6.0", |
17 | org.apache.batik.dom;bundle-version="[1.6.1,1.6.2]", | ||
18 | org.apache.batik.bridge;bundle-version="[1.6.0,1.6.1]", | ||
19 | org.apache.batik.dom.svg;bundle-version="[1.6.0,1.6.1]", | ||
20 | org.apache.batik.util;bundle-version="[1.6.0,1.6.1]", | ||
21 | org.apache.batik.css;bundle-version="[1.6.0,1.6.1]", | ||
22 | org.apache.batik.parser;bundle-version="[1.6.0,1.6.1]", | ||
23 | org.apache.batik.pdf;bundle-version="[1.6.0,1.6.1]", | ||
24 | org.apache.batik.svggen;bundle-version="[1.6.0,1.6.1]", | ||
25 | org.apache.batik.xml;bundle-version="[1.6.0,1.6.1]", | ||
26 | org.apache.batik.ext.awt;bundle-version="[1.6.0,1.6.1]", | ||
27 | org.apache.batik.util.gui;bundle-version="[1.6.0,1.6.1]", | ||
28 | org.apache.xerces;bundle-version="2.9.0", | ||
29 | org.w3c.dom.svg;bundle-version="1.1.0", | ||
30 | org.w3c.css.sac;bundle-version="1.3.1" | ||
31 | Import-Package: com.eclipsesource.v8;version="4.6.0", | ||
32 | com.eclipsesource.v8.debug;version="4.6.0", | ||
33 | com.eclipsesource.v8.utils;version="4.6.0", | ||
34 | com.eclipsesource.v8.utils.typedarrays;version="4.6.0", | ||
35 | javax.imageio, | ||
36 | javax.xml.parsers, | ||
37 | org.apache.log4j;version="1.2.15", | ||
38 | org.slf4j;version="1.7.2", | ||
39 | org.w3c.dom, | ||
40 | org.xml.sax, | ||
41 | org.xml.sax.helpers | ||
17 | Export-Package: hu.bme.mit.inf.dslreasoner.visualisation.pi2graphviz | 42 | Export-Package: hu.bme.mit.inf.dslreasoner.visualisation.pi2graphviz |
18 | Automatic-Module-Name: hu.bme.mit.inf.dslreasoner.visualisation | 43 | Automatic-Module-Name: hu.bme.mit.inf.dslreasoner.visualisation |
19 | 44 | ||
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/VisualisationQueque.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/VisualisationQueque.xtend index 79074bfc..b067ba7d 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/VisualisationQueque.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/VisualisationQueque.xtend | |||
@@ -11,6 +11,7 @@ import java.util.concurrent.BlockingQueue | |||
11 | import java.util.concurrent.CompletableFuture | 11 | import java.util.concurrent.CompletableFuture |
12 | import java.util.concurrent.LinkedBlockingQueue | 12 | import java.util.concurrent.LinkedBlockingQueue |
13 | import org.eclipse.xtend.lib.annotations.Data | 13 | import org.eclipse.xtend.lib.annotations.Data |
14 | import java.util.function.Consumer | ||
14 | 15 | ||
15 | class VisualisationQueque { | 16 | class VisualisationQueque { |
16 | val BlockingQueue<VisualisationQueueEntry> taskQueue = new LinkedBlockingQueue | 17 | val BlockingQueue<VisualisationQueueEntry> taskQueue = new LinkedBlockingQueue |
@@ -43,9 +44,12 @@ class VisualisationQueque { | |||
43 | // do nothing | 44 | // do nothing |
44 | } else { | 45 | } else { |
45 | runnerThread = new Thread(new Runnable() { | 46 | runnerThread = new Thread(new Runnable() { |
46 | val engine = new GraphvizV8Engine() | ||
47 | |||
48 | override run() { | 47 | override run() { |
48 | val engine = new GraphvizV8Engine() | ||
49 | val nullConsumer = new Consumer<GraphvizEngine>() { | ||
50 | override accept(GraphvizEngine t) {} | ||
51 | } | ||
52 | engine.init(nullConsumer,nullConsumer) | ||
49 | //println("Visualisation thread started") | 53 | //println("Visualisation thread started") |
50 | while(true) { | 54 | while(true) { |
51 | val head = taskQueue.take | 55 | val head = taskQueue.take |