Full name reference - Classifiers seem not to be equal [message #1066585] |
Wed, 03 July 2013 10:05 |
Thomas Haarhoff Messages: 8 Registered: December 2012 Location: Germany |
Junior Member |
|
|
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
|
|
|
Re: Full name reference - Classifiers seem not to be equal [message #1066645 is a reply to message #1066585] |
Wed, 03 July 2013 14:32 |
Thomas Haarhoff Messages: 8 Registered: December 2012 Location: Germany |
Junior Member |
|
|
Small update.
I tried to change the header of the transformations.
In the version above I used
I changed it. So the transformation is now using the URI.
But now also the first transformation isn't working any more.
with the Error:
org.eclipse.m2m.atl.engine.emfvm.VMException: Cannot find class IN::expressions::Equal in reference model IN
Is there a problem with using the nsURI and the full name reference?
Thomas
*EDIT*
fixed it. Just switching to Runtime Workbench.
By switching from @path to @nsURI also the first error disappeard.
Sorry for all that confusing stuff :/
Thomas
[Updated on: Wed, 03 July 2013 15:45] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03033 seconds