diff options
author | 2019-03-20 16:09:09 +0100 | |
---|---|---|
committer | 2019-03-20 16:09:09 +0100 | |
commit | 3f5aaab5025b8eb243f414b1c789085327df04f4 (patch) | |
tree | 156d9d95888fce6b003d73f509b9155e6b24555f /Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src/hu/bme/mit/inf | |
parent | Fix ParseUtil to avoid breaking the .vql editor in Eclipse (diff) | |
download | VIATRA-Generator-3f5aaab5025b8eb243f414b1c789085327df04f4.tar.gz VIATRA-Generator-3f5aaab5025b8eb243f414b1c789085327df04f4.tar.zst VIATRA-Generator-3f5aaab5025b8eb243f414b1c789085327df04f4.zip |
Fault tree transformation for partial models WIP
Diffstat (limited to 'Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src/hu/bme/mit/inf')
-rw-r--r-- | Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/CftLanguageScopeProvider.xtend | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/CftLanguageScopeProvider.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/CftLanguageScopeProvider.xtend index e95d8c91..f295f116 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/CftLanguageScopeProvider.xtend +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src/hu/bme/mit/inf/dslreasoner/faulttree/components/scoping/CftLanguageScopeProvider.xtend | |||
@@ -11,6 +11,7 @@ import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.LookupDefinit | |||
11 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.MappingDefinition | 11 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.MappingDefinition |
12 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.TransformationDefinition | 12 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.TransformationDefinition |
13 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.Variable | 13 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.Variable |
14 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.impl.MappingDefinitionImpl | ||
14 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentDefinition | 15 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentDefinition |
15 | import org.eclipse.emf.common.notify.Notifier | 16 | import org.eclipse.emf.common.notify.Notifier |
16 | import org.eclipse.emf.ecore.EObject | 17 | import org.eclipse.emf.ecore.EObject |
@@ -68,7 +69,7 @@ class CftLanguageScopeProvider extends AbstractCftLanguageScopeProvider { | |||
68 | Iterable<? extends MappingDefinition> ruleDefinitions) { | 69 | Iterable<? extends MappingDefinition> ruleDefinitions) { |
69 | val mappingDefinitionDescriptions = Lists.newArrayListWithExpectedSize(ruleDefinitions.size) | 70 | val mappingDefinitionDescriptions = Lists.newArrayListWithExpectedSize(ruleDefinitions.size) |
70 | for (ruleDefinition : ruleDefinitions) { | 71 | for (ruleDefinition : ruleDefinitions) { |
71 | val pattern = ruleDefinition?.pattern | 72 | val pattern = ruleDefinition.safelyGetPattern |
72 | if (pattern !== null) { | 73 | if (pattern !== null) { |
73 | val patternName = resourceDescriptions.getExportedObjectsByObject(pattern).head?.qualifiedName | 74 | val patternName = resourceDescriptions.getExportedObjectsByObject(pattern).head?.qualifiedName |
74 | if (patternName !== null) { | 75 | if (patternName !== null) { |
@@ -79,6 +80,14 @@ class CftLanguageScopeProvider extends AbstractCftLanguageScopeProvider { | |||
79 | } | 80 | } |
80 | mappingDefinitionDescriptions | 81 | mappingDefinitionDescriptions |
81 | } | 82 | } |
83 | |||
84 | private def safelyGetPattern(MappingDefinition mappingDefinition) { | ||
85 | switch (mappingDefinition) { | ||
86 | MappingDefinitionImpl: mappingDefinition.basicGetPattern | ||
87 | case null: null | ||
88 | default: mappingDefinition.pattern | ||
89 | } | ||
90 | } | ||
82 | 91 | ||
83 | private def getResourceDescriptions(Notifier notifier) { | 92 | private def getResourceDescriptions(Notifier notifier) { |
84 | val resourceSet = EcoreUtil2.getResourceSet(notifier) | 93 | val resourceSet = EcoreUtil2.getResourceSet(notifier) |