Full name reference - Classifiers seem not to be equal [message #1066585] |
Wed, 03 July 2013 06:05  |
Eclipse User |
|
|
|
Hello,
I have to rules here for you.
rule CompareUse {
from input: IN!InstructionDef(input.instruction.oclIsTypeOf(IN!Compare))
to
outI :OUT!LocalComputation(
expression <- lexpr,
instructionResult <- intReg
),
intReg: OUT!Variable (
name <- input.register
),
lexpr : OUT!"expressions::Equal"(
left <- left,
right <- right
),
left : OUT!"expressions::StringValue"(
strValue <- input.instruction.value1
),
right : OUT!"expressions::StringValue"(
strValue <- input.instruction.value2
)
}
rule BranchCompare {
from input: MM!LocalComputation(input.expression.oclIsTypeOf(MM!"expressions::Equal"))
...
}
The rule CompareUse is from a Model-2-Model Transformation and the snippet of the rule BranchCompare is from a refining transformation.
Short Overview:
M2M: Transform every Compare Instruction from IN to a OUT!LocalComputation with an expression(Equal here).
Ref: Select all LocalComputations that have an equal expression.
-
After the M2M Transformation the new Model contains LocalComputations like this:
<instructions xsi:type="LocalComputation">
<instructionResult name="cmp2"/>
<expression xsi:type="expressions:Equal">
<left xsi:type="expressions:StringValue" strValue="1"/>
<right xsi:type="expressions:StringValue" strValue="1"/>
</expression>
</instructions>
Thats ok so far.
The refining on the other hand doesn't work.
If i debug the snippet like this:
from
input: MM!LocalComputation (
input.expression.oclIsTypeOf(MM!"expressions::Equal").debug(input.expression.oclType())
I get:
org.eclipse.emf.ecore.impl.EClassImpl@71f68c1b (name: Equal) (instanceClassName: null) (abstract: false, interface: false): false
But if I'm wrong that should be true... not false.
Thanks for reading and your time,
Thomas
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07373 seconds