diff options
author | 2020-05-07 20:28:24 +0200 | |
---|---|---|
committer | 2020-05-07 20:28:24 +0200 | |
commit | 4d3ed3d9354e7f158210f70eddead078df520fbb (patch) | |
tree | 2b06f3cad3b0cf3ed61f4b7201059e0dd221e3a1 /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf | |
parent | Rebuild with Eclipse 2020-03 (diff) | |
download | VIATRA-Generator-4d3ed3d9354e7f158210f70eddead078df520fbb.tar.gz VIATRA-Generator-4d3ed3d9354e7f158210f70eddead078df520fbb.tar.zst VIATRA-Generator-4d3ed3d9354e7f158210f70eddead078df520fbb.zip |
Fix check expressions in generated VIATRA
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/util/ParseUtil.xtend | 29 |
1 files changed, 25 insertions, 4 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 8e264488..26ec7091 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 | |||
@@ -196,8 +196,20 @@ class ParseUtil { | |||
196 | } | 196 | } |
197 | 197 | ||
198 | class FixedMetamodelProvider implements IMetamodelProvider { | 198 | class FixedMetamodelProvider implements IMetamodelProvider { |
199 | |||
200 | static val EPACKAGE_TO_PLUGIN_MAP = #{ | ||
201 | PartialinterpretationPackage.eINSTANCE -> "hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage", | ||
202 | LogicproblemPackage.eINSTANCE -> "hu.bme.mit.inf.dslreasoner.logic.model", | ||
203 | LogiclanguagePackage.eINSTANCE -> "hu.bme.mit.inf.dslreasoner.logic.model" | ||
204 | } | ||
205 | |||
206 | static val EPACKAGE_TO_JAVA_PACKAGE_MAP = #{ | ||
207 | PartialinterpretationPackage.eINSTANCE -> "hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation", | ||
208 | LogicproblemPackage.eINSTANCE -> "hu.bme.mit.inf.dslreasoner.logic.model.logicproblem", | ||
209 | LogiclanguagePackage.eINSTANCE -> "hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage" | ||
210 | } | ||
199 | 211 | ||
200 | protected val List<EPackage> packages = new LinkedList | 212 | val List<EPackage> packages = new LinkedList |
201 | 213 | ||
202 | new() { | 214 | new() { |
203 | packages += PartialinterpretationPackage.eINSTANCE | 215 | packages += PartialinterpretationPackage.eINSTANCE |
@@ -213,15 +225,24 @@ class FixedMetamodelProvider implements IMetamodelProvider { | |||
213 | } | 225 | } |
214 | 226 | ||
215 | override boolean isGeneratedCodeAvailable(EPackage ePackage, ResourceSet set) { | 227 | override boolean isGeneratedCodeAvailable(EPackage ePackage, ResourceSet set) { |
216 | true | 228 | EPACKAGE_TO_PLUGIN_MAP.containsKey(ePackage) |
217 | } | 229 | } |
218 | 230 | ||
219 | override String getModelPluginId(EPackage ePackage, ResourceSet set) { | 231 | override String getModelPluginId(EPackage ePackage, ResourceSet set) { |
220 | return "hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage" | 232 | EPACKAGE_TO_PLUGIN_MAP.get(ePackage) |
221 | } | 233 | } |
222 | 234 | ||
223 | override String getQualifiedClassName(EClassifier classifier, EObject context) { | 235 | override String getQualifiedClassName(EClassifier classifier, EObject context) { |
224 | classifier.name | 236 | val instanceClassName = classifier.instanceClassName |
237 | if (instanceClassName !== null) { | ||
238 | return instanceClassName | ||
239 | } | ||
240 | val javaPackage = EPACKAGE_TO_JAVA_PACKAGE_MAP.get(classifier.EPackage) | ||
241 | if (javaPackage !== null) { | ||
242 | javaPackage + "." + classifier.name | ||
243 | } else { | ||
244 | null | ||
245 | } | ||
225 | } | 246 | } |
226 | 247 | ||
227 | override loadEPackage(String uri, ResourceSet resourceSet) { | 248 | override loadEPackage(String uri, ResourceSet resourceSet) { |