diff options
author | 2017-08-02 20:16:20 +0200 | |
---|---|---|
committer | 2017-08-02 20:16:20 +0200 | |
commit | 942dcb2f66ac2317e17bea84b13fabce805e0b8e (patch) | |
tree | c426bd2e48db9cc526af854e9308686cd2490c18 | |
parent | Removed dependency (diff) | |
download | VIATRA-Generator-942dcb2f66ac2317e17bea84b13fabce805e0b8e.tar.gz VIATRA-Generator-942dcb2f66ac2317e17bea84b13fabce805e0b8e.tar.zst VIATRA-Generator-942dcb2f66ac2317e17bea84b13fabce805e0b8e.zip |
Added methods to decide which attribure or enum type is mapped ot the
logic problem.
2 files changed, 17 insertions, 1 deletions
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/AttributeMapper.xtend b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/AttributeMapper.xtend index b78ad89f..74f82a13 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/AttributeMapper.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/AttributeMapper.xtend | |||
@@ -18,6 +18,7 @@ interface EAttributeMapper { | |||
18 | def Term IsAttributeValue(Ecore2Logic_Trace trace, TermDescription object, TermDescription value, EAttribute attribute) | 18 | def Term IsAttributeValue(Ecore2Logic_Trace trace, TermDescription object, TermDescription value, EAttribute attribute) |
19 | def RelationDeclaration relationOfAttribute(Ecore2Logic_Trace trace, EAttribute attribute) | 19 | def RelationDeclaration relationOfAttribute(Ecore2Logic_Trace trace, EAttribute attribute) |
20 | def TypeDescriptor TypeOfRange(Ecore2Logic_Trace trace, EAttribute attribute) | 20 | def TypeDescriptor TypeOfRange(Ecore2Logic_Trace trace, EAttribute attribute) |
21 | def Iterable<EAttribute> allAttributesInScope(Ecore2Logic_Trace trace) | ||
21 | } | 22 | } |
22 | 23 | ||
23 | class EAttributeMapper_RelationsOverTypes_Trace implements Trace<EAttributeMapper_RelationsOverTypes>{ | 24 | class EAttributeMapper_RelationsOverTypes_Trace implements Trace<EAttributeMapper_RelationsOverTypes>{ |
@@ -116,4 +117,9 @@ class EAttributeMapper_RelationsOverTypes implements EAttributeMapper { | |||
116 | override relationOfAttribute(Ecore2Logic_Trace trace, EAttribute attribute) { | 117 | override relationOfAttribute(Ecore2Logic_Trace trace, EAttribute attribute) { |
117 | trace.attributeMapperTrace.asTrace.indicators.get(attribute) | 118 | trace.attributeMapperTrace.asTrace.indicators.get(attribute) |
118 | } | 119 | } |
120 | |||
121 | override allAttributesInScope(Ecore2Logic_Trace trace) { | ||
122 | trace.attributeMapperTrace.asTrace.indicators.keySet | ||
123 | } | ||
124 | |||
119 | } \ No newline at end of file | 125 | } \ No newline at end of file |
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EEnumMapper.xtend b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EEnumMapper.xtend index 82aee1e2..5935c6d0 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EEnumMapper.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.ecore2logic/src/hu/bme/mit/inf/dslreasoner/ecore2logic/EEnumMapper.xtend | |||
@@ -17,11 +17,12 @@ interface EEnumMapper { | |||
17 | def void transformEEnums(Ecore2Logic_Trace trace, LogicProblem problem, Iterable<EEnum> enums,Ecore2LogicConfiguration config) | 17 | def void transformEEnums(Ecore2Logic_Trace trace, LogicProblem problem, Iterable<EEnum> enums,Ecore2LogicConfiguration config) |
18 | def Type TypeofEEnum(Ecore2Logic_Trace trace, EEnum type) | 18 | def Type TypeofEEnum(Ecore2Logic_Trace trace, EEnum type) |
19 | def TermDescription Literal(Ecore2Logic_Trace trace, Enumerator literal) | 19 | def TermDescription Literal(Ecore2Logic_Trace trace, Enumerator literal) |
20 | def Iterable<EEnum> allEnumsInScope(Ecore2Logic_Trace trace) | ||
21 | def Iterable<Enumerator> allLiteralsInScope(Ecore2Logic_Trace trace) | ||
20 | } | 22 | } |
21 | 23 | ||
22 | class EEnumMapper_PredefinedClasses_Trace implements Trace<EEnumMapper_PredefinedClasses>{ | 24 | class EEnumMapper_PredefinedClasses_Trace implements Trace<EEnumMapper_PredefinedClasses>{ |
23 | public var Map<EEnum, Type> enums | 25 | public var Map<EEnum, Type> enums |
24 | |||
25 | public var Map<Enumerator,DefinedElement> literals | 26 | public var Map<Enumerator,DefinedElement> literals |
26 | } | 27 | } |
27 | 28 | ||
@@ -57,4 +58,13 @@ class EEnumMapper_PredefinedClasses implements EEnumMapper { | |||
57 | override Literal(Ecore2Logic_Trace trace, Enumerator literal) { | 58 | override Literal(Ecore2Logic_Trace trace, Enumerator literal) { |
58 | literal.lookup(trace.enumMapperTrace.asTrace.literals) | 59 | literal.lookup(trace.enumMapperTrace.asTrace.literals) |
59 | } | 60 | } |
61 | |||
62 | override allEnumsInScope(Ecore2Logic_Trace trace) { | ||
63 | trace.enumMapperTrace.asTrace.enums.keySet | ||
64 | } | ||
65 | |||
66 | override allLiteralsInScope(Ecore2Logic_Trace trace) { | ||
67 | trace.enumMapperTrace.asTrace.literals.keySet | ||
68 | } | ||
69 | |||
60 | } \ No newline at end of file | 70 | } \ No newline at end of file |