Revert "EMFTVM compiler optimizations."
This reverts commit 6f73aa1a4014ac3f6ee8befbc670c115143cdf2e.
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/ATLtoEMFTVM.atl b/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/ATLtoEMFTVM.atl
index 68caa92..e3d21a8 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/ATLtoEMFTVM.atl
+++ b/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/ATLtoEMFTVM.atl
@@ -131,11 +131,11 @@
endif;
--- Returns the source code location representing the apply section of this rule.
-helper context ATL!Rule def : applyLoc : ATL!LocatedElement =
+helper context ATL!Rule def : applyLoc : String =
if self.outPattern.oclIsUndefined() then
- self
+ self.location
else
- self.outPattern
+ self.outPattern.location
endif;
--- Support for multiple rule inheritance, including rules outside same module
@@ -297,22 +297,23 @@
abstract rule Unit {
from s : ATL!Unit in IN
to t : EMFTVM!Module (
- name <:= s.name,
- sourceName <:=
+ name <- s.name,
+ sourceName <-
let index : Integer = s.name.lastIndexOf('::') in
if index > 0 then
s.name.substring(index + 2, s.name.size()) + '.atl'
else
s.name + '.atl'
endif,
- imports <:= s.libraries->collect(l|l.name)),
+ imports <- s.libraries->collect(l|l.name),
+ features <- Sequence{main}),
main : EMFTVM!Operation (
- name <:= 'main',
- static <:= true,
- "context" <:= 'ExecEnv',
- contextModel <:= 'EMFTVM',
- type <:= 'Object',
- typeModel <:= '#native')
+ name <- 'main',
+ static <- true,
+ "context" <- 'ExecEnv',
+ contextModel <- 'EMFTVM',
+ type <- 'Object',
+ typeModel <- '#native')
}
rule Library extends Unit {
@@ -320,7 +321,7 @@
to t : EMFTVM!Module (
features <- s.helpers->collect(h|h.definition)->append(main)),
main : EMFTVM!Operation (
- body <:= body),
+ body <- body),
body : EMFTVM!CodeBlock
}
@@ -343,14 +344,14 @@
->append(main),
rules <- s.elements->select(e|e.oclIsKindOf(ATL!MatchedRule))),
main : EMFTVM!Operation (
- body <:= body),
+ body <- body),
body : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln}),
+ lineNumbers <- Sequence{ln}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn)
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn)
}
rule ModuleWithEntryPoint extends Module {
@@ -363,9 +364,9 @@
}
to t : EMFTVM!Module,
body : EMFTVM!CodeBlock (
- code <:= Sequence{getenvtype_entry, invoke_entry}),
+ code <- Sequence{getenvtype_entry, invoke_entry}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{getenvtype_entry, invoke_entry}),
+ instructions <- Sequence{getenvtype_entry, invoke_entry}),
getenvtype_entry : EMFTVM!Getenvtype, -- [..., ExecEnv]
invoke_entry : EMFTVM!InvokeStatic ( -- [..., result]
opname <- entryPointRule.name,
@@ -386,9 +387,9 @@
}
to t : EMFTVM!Module,
body : EMFTVM!CodeBlock (
- code <:= Sequence{getenvtype_end, invoke_end}),
+ code <- Sequence{getenvtype_end, invoke_end}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{getenvtype_end, invoke_end}),
+ instructions <- Sequence{getenvtype_end, invoke_end}),
getenvtype_end : EMFTVM!Getenvtype, -- [..., ExecEnv]
invoke_end : EMFTVM!InvokeStatic ( -- [..., result]
opname <- endPointRule.name,
@@ -407,9 +408,9 @@
}
to t : EMFTVM!Module,
body : EMFTVM!CodeBlock (
- code <:= Sequence{getenvtype_entry, invoke_entry, pop, getenvtype_end, invoke_end}),
+ code <- Sequence{getenvtype_entry, invoke_entry, pop, getenvtype_end, invoke_end}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{getenvtype_entry, invoke_entry, pop, getenvtype_end, invoke_end}),
+ instructions <- Sequence{getenvtype_entry, invoke_entry, pop, getenvtype_end, invoke_end}),
getenvtype_entry : EMFTVM!Getenvtype, -- [..., ExecEnv]
invoke_entry : EMFTVM!InvokeStatic ( -- [..., result]
opname <- entryPointRule.name,
@@ -548,14 +549,14 @@
endif;
}
to cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
- code <:= Sequence{findtype, new, store}),
+ lineNumbers <- Sequence{ln},
+ code <- Sequence{findtype, new, store}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{findtype, new, store}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{findtype, new, store}),
lv : EMFTVM!LocalVariable (
name <- s.varName,
type <- s.type.typeName,
@@ -574,15 +575,15 @@
type <- s.type.typeName,
typeModel <- s.type.modelName),
cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{s.initExpression},
- code <:= Sequence{invokeCb, store}),
+ code <- Sequence{invokeCb, store}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{invokeCb, store}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{invokeCb, store}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.initExpression, argcount <- 0), -- [..., value]
store : EMFTVM!Store (localVariable <- s) -- [...]
}
@@ -599,7 +600,7 @@
parameters <- s.parameters,
body <- body),
body : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
localVariables <- s.parameters->collect(p|thisModule.resolveTemp(p, 'lv'))
->union(s.outPatternElements->collect(p|thisModule.resolveTemp(p, 'lv')))
->union(s.variables),
@@ -612,13 +613,13 @@
else
s.actionBlock.statements
endif),
- code <:= Sequence{invokeAllCbs}),
+ code <- Sequence{invokeAllCbs}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{invokeAllCbs}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{invokeAllCbs}),
invokeAllCbs : EMFTVM!InvokeAllCbs -- [...]
}
@@ -642,15 +643,15 @@
initialiser <- init),
init : EMFTVM!CodeBlock, -- Empty initialiser
cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{s.initExpression},
- code <:= Sequence{load, invokeCb, set}),
+ code <- Sequence{load, invokeCb, set}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{load, invokeCb, set}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{load, invokeCb, set}),
load : EMFTVM!Load (localVariable <- thisModule.resolveTemp(s."rule", 'a_trace')), -- [..., trace]
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.initExpression, argcount <- 0), -- [..., trace, value]
set : EMFTVM!"Set" (fieldname <- s.varName) -- [...]
@@ -697,7 +698,7 @@
fields <- s.variables,
applier <- a),
a : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{aln},
+ lineNumbers <- Sequence{aln},
localVariables <- Sequence{a_trace}
->union(s.inPattern.elements->collect(e|thisModule.resolveTemp(e, 'ov')))
->union(s.outPatternElements->reject(e|e.isRefiningElement)->collect(e|thisModule.resolveTemp(e, 'ov'))),
@@ -719,13 +720,13 @@
)}
endif
),
- code <:= Sequence{a_invokeAllCbs}),
+ code <- Sequence{a_invokeAllCbs}),
aln : EMFTVM!LineNumber (
startLine <- s.applyLoc.startLine,
startColumn <- s.applyLoc.startColumn,
endLine <- s.applyLoc.endLine,
endColumn <- s.applyLoc.endColumn,
- instructions <:= Sequence{a_invokeAllCbs}),
+ instructions <- Sequence{a_invokeAllCbs}),
a_trace : EMFTVM!LocalVariable (
name <- '__trace__',
type <- 'TraceLink',
@@ -737,21 +738,21 @@
from s : ATL!MatchedRule in IN (
not s.inPattern.filter.oclIsUndefined())
using {
- matchLoc : ATL!LocatedElement = s.inPattern.filter;
+ matchLoc : String = s.inPattern.filter.location;
}
to t : EMFTVM!Rule (
matcher <- m),
m : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{mln},
+ lineNumbers <- Sequence{mln},
localVariables <- s.inPattern.elements->collect(e|thisModule.resolveTemp(e, 'lv')),
nested <- Sequence{s.inPattern.filter},
- code <:= Sequence{invokeCb}),
+ code <- Sequence{invokeCb}),
mln : EMFTVM!LineNumber (
startLine <- matchLoc.startLine,
startColumn <- matchLoc.startColumn,
endLine <- matchLoc.endLine,
endColumn <- matchLoc.endColumn,
- instructions <:= Sequence{invokeCb}),
+ instructions <- Sequence{invokeCb}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.inPattern.filter)
}
@@ -759,7 +760,7 @@
from s : ATL!MatchedRule in IN (
not s.actionBlock.oclIsUndefined())
using {
- postLoc : ATL!LocatedElement = s.actionBlock;
+ postLoc : String = s.actionBlock.location;
}
to t : EMFTVM!Rule (
postApply <- p),
@@ -767,9 +768,9 @@
localVariables <- Sequence{p_trace}
->union(s.inPattern.elements->collect(e|thisModule.resolveTemp(e, 'pv')))
->union(s.outPatternElements->reject(e|e.isRefiningElement)->collect(e|thisModule.resolveTemp(e, 'pv'))),
- lineNumbers <:= Sequence{pln},
+ lineNumbers <- Sequence{pln},
nested <- s.actionBlock.statements,
- code <:= Sequence{p_invokeAllCbs}),
+ code <- Sequence{p_invokeAllCbs}),
p_trace : EMFTVM!LocalVariable (
name <- '__trace__',
type <- 'TraceLink',
@@ -779,7 +780,7 @@
startColumn <- postLoc.startColumn,
endLine <- postLoc.endLine,
endColumn <- postLoc.endColumn,
- instructions <:= Sequence{p_invokeAllCbs}),
+ instructions <- Sequence{p_invokeAllCbs}),
p_invokeAllCbs : EMFTVM!InvokeAllCbs -- [..., value]
}
@@ -808,15 +809,15 @@
endif;
}
to cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{s.value},
- code <:= Sequence{load, invokeCb, set}),
+ code <- Sequence{load, invokeCb, set}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{load, invokeCb, set}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{load, invokeCb, set}),
load : EMFTVM!Load (
localVariable <- -- [..., lv]
if s.parentRule.oclIsKindOf(ATL!MatchedRule) then
@@ -831,9 +832,9 @@
rule ResolvingBinding extends Binding {
from s : ATL!Binding in IN (not s.isAssignment)
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{load, invokeCb, invoke, set}),
+ code <- Sequence{load, invokeCb, invoke, set}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{load, invokeCb, invoke, set}),
+ instructions <- Sequence{load, invokeCb, invoke, set}),
load : EMFTVM!Load, -- [..., lv]
invokeCb : EMFTVM!InvokeCb, -- [..., lv, value]
invoke : EMFTVM!Invoke (opname <- 'resolve', argcount <- 0), -- [..., lv, rvalue]
@@ -845,15 +846,15 @@
rule ExpressionStat {
from s : ATL!ExpressionStat in IN
to cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{s.expression},
- code <:= Sequence{invokeCb}),
+ code <- Sequence{invokeCb}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{invokeCb}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{invokeCb}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.expression, argcount <- 0) -- [..., value]
}
@@ -862,9 +863,9 @@
not s.refImmediateComposite().oclIsKindOf(ATL!ActionBlock) or
s.refImmediateComposite().statements->last() <> s)
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{invokeCb, pop}),
+ code <- Sequence{invokeCb, pop}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb, pop}),
+ instructions <- Sequence{invokeCb, pop}),
invokeCb : EMFTVM!InvokeCb, -- [..., value]
pop : EMFTVM!Pop -- [...]
}
@@ -873,15 +874,15 @@
from s : ATL!BindingStat in IN (
s.source.oclIsKindOf(ATL!NavigationOrAttributeCallExp))
to cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{s.source.source, s.value},
- code <:= Sequence{invokeCb, invokeCb2, set}),
+ code <- Sequence{invokeCb, invokeCb2, set}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{invokeCb, invokeCb2, set}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{invokeCb, invokeCb2, set}),
invokeCb : EMFTVM!InvokeCb ( -- [..., source]
codeBlock <- s.source.source, argcount <- 0),
invokeCb2 : EMFTVM!InvokeCb (codeBlock <- s.value, argcount <- 0), -- [..., source, value]
@@ -900,9 +901,9 @@
rule ResolvingBindingStatAttribute extends BindingStatAttribute {
from s : ATL!BindingStat in IN (not s.isAssignment)
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{invokeCb, invokeCb2, invoke, set}),
+ code <- Sequence{invokeCb, invokeCb2, invoke, set}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb, invokeCb2, invoke, set}),
+ instructions <- Sequence{invokeCb, invokeCb2, invoke, set}),
invokeCb : EMFTVM!InvokeCb, -- [..., source]
invokeCb2 : EMFTVM!InvokeCb, -- [..., source, value]
invoke : EMFTVM!Invoke (opname <- 'resolve', argcount <- 0), -- [..., source, rvalue]
@@ -921,9 +922,9 @@
rule ResolvingBindingStatStaticAttribute extends BindingStatStaticAttribute {
from s : ATL!BindingStat in IN (not s.isAssignment)
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{invokeCb, invokeCb2, invoke, set}),
+ code <- Sequence{invokeCb, invokeCb2, invoke, set}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb, invokeCb2, invoke, set}),
+ instructions <- Sequence{invokeCb, invokeCb2, invoke, set}),
invokeCb : EMFTVM!InvokeCb, -- [..., source]
invokeCb2 : EMFTVM!InvokeCb, -- [..., source, value]
invoke : EMFTVM!Invoke (opname <- 'resolve', argcount <- 0), -- [..., source, rvalue]
@@ -936,15 +937,15 @@
s.source.referredVariable.varName <> 'thisModule' and
not s.source.referredVariable.isMatchedRuleField)
to cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{s.value},
- code <:= Sequence{invokeCb, store}),
+ code <- Sequence{invokeCb, store}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{invokeCb, store}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{invokeCb, store}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.value, argcount <- 0), -- [..., value]
store : EMFTVM!Store (localVariable <- s.source.referredVariable) -- [...]
}
@@ -952,9 +953,9 @@
rule ResolvingBindingStatVariable extends BindingStatVariable {
from s : ATL!BindingStat in IN (not s.isAssignment)
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{invokeCb, invoke, store}),
+ code <- Sequence{invokeCb, invoke, store}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb, invoke, store}),
+ instructions <- Sequence{invokeCb, invoke, store}),
invokeCb : EMFTVM!InvokeCb, -- [..., value]
invoke : EMFTVM!Invoke (opname <- 'resolve', argcount <- 0), -- [..., rvalue]
store : EMFTVM!Store -- [...]
@@ -965,15 +966,15 @@
s.source.oclIsKindOf(ATL!VariableExp) and
s.source.referredVariable.isMatchedRuleField)
to cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{s.value},
- code <:= Sequence{load, invokeCb, set}),
+ code <- Sequence{load, invokeCb, set}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{load, invokeCb, set}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{load, invokeCb, set}),
load : EMFTVM!Load (localVariable <- s.source.traceVariable()), -- [..., trace]
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.value, argcount <- 0), -- [..., trace, value]
set : EMFTVM!"Set" (fieldname <- s.source.referredVariable.varName) -- [...]
@@ -982,9 +983,9 @@
rule ResolvingBindingStatRuleField extends BindingStatRuleField {
from s : ATL!BindingStat in IN (not s.isAssignment)
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{load, invokeCb, invoke, set}),
+ code <- Sequence{load, invokeCb, invoke, set}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{load, invokeCb, invoke, set}),
+ instructions <- Sequence{load, invokeCb, invoke, set}),
load : EMFTVM!Load, -- [..., trace]
invokeCb : EMFTVM!InvokeCb, -- [..., trace, value]
invoke : EMFTVM!Invoke (opname <- 'resolve', argcount <- 0), -- [..., trace, rvalue]
@@ -994,27 +995,27 @@
abstract rule IfStat {
from s : ATL!IfStat in IN
to cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln}),
+ lineNumbers <- Sequence{ln}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.condition, argcount <- 0) -- [..., cond]
}
rule IfStatWithThenAndElse extends IfStat {
from s : ATL!IfStat in IN (s.thenStatements->notEmpty() and s.elseStatements->notEmpty())
to cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{s.condition, thenCb, elseCb},
- code <:= Sequence{invokeCb, ifn, invokeThen, goto, invokeElse}),
+ code <- Sequence{invokeCb, ifn, invokeThen, goto, invokeElse}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{invokeCb, ifn, invokeThen, goto, invokeElse}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{invokeCb, ifn, invokeThen, goto, invokeElse}),
invokeCb : EMFTVM!InvokeCb, -- [..., cond]
ifn : EMFTVM!Ifn (target <- goto), -- [...]
invokeThen : EMFTVM!InvokeCb (codeBlock <- thenCb, argcount <- 0), -- [..., result]
@@ -1022,68 +1023,68 @@
invokeElse : EMFTVM!InvokeCb (codeBlock <- elseCb, argcount <- 0), -- [..., result]
thenCb : EMFTVM!CodeBlock (
nested <- s.thenStatements,
- code <:= Sequence{invokeAllCbs}),
+ code <- Sequence{invokeAllCbs}),
invokeAllCbs : EMFTVM!InvokeAllCbs (argcount <- 0),
elseCb : EMFTVM!CodeBlock (
nested <- s.elseStatements,
- code <:= Sequence{invokeAllCbs2}),
+ code <- Sequence{invokeAllCbs2}),
invokeAllCbs2 : EMFTVM!InvokeAllCbs (argcount <- 0)
}
rule IfStatWithThen extends IfStat {
from s : ATL!IfStat in IN (s.thenStatements->notEmpty() and s.elseStatements->isEmpty())
to cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{s.condition, thenCb},
- code <:= Sequence{invokeCb, ifn, invokeThen}),
+ code <- Sequence{invokeCb, ifn, invokeThen}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{invokeCb, ifn, invokeThen}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{invokeCb, ifn, invokeThen}),
invokeCb : EMFTVM!InvokeCb, -- [..., cond]
ifn : EMFTVM!Ifn (target <- invokeThen), -- [...]
invokeThen : EMFTVM!InvokeCb (codeBlock <- thenCb, argcount <- 0), -- [..., result]
thenCb : EMFTVM!CodeBlock (
nested <- s.thenStatements,
- code <:= Sequence{invokeAllCbs}),
+ code <- Sequence{invokeAllCbs}),
invokeAllCbs : EMFTVM!InvokeAllCbs (argcount <- 0)
}
rule IfStatWithElse extends IfStat {
from s : ATL!IfStat in IN (s.thenStatements->isEmpty() and s.elseStatements->notEmpty())
to cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{s.condition, elseCb},
- code <:= Sequence{invokeCb, ift, invokeElse}),
+ code <- Sequence{invokeCb, ift, invokeElse}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{invokeCb, ift, invokeElse}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{invokeCb, ift, invokeElse}),
invokeCb : EMFTVM!InvokeCb, -- [..., cond]
ift : EMFTVM!If (target <- invokeElse), -- [...]
invokeElse : EMFTVM!InvokeCb (codeBlock <- elseCb, argcount <- 0), -- [..., result]
elseCb : EMFTVM!CodeBlock (
nested <- s.elseStatements,
- code <:= Sequence{invokeAllCbs2}),
+ code <- Sequence{invokeAllCbs2}),
invokeAllCbs2 : EMFTVM!InvokeAllCbs (argcount <- 0)
}
rule IfStatWithNothing extends IfStat {
from s : ATL!IfStat in IN (s.thenStatements->isEmpty() and s.elseStatements->isEmpty())
to cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{s.condition},
- code <:= Sequence{invokeCb, pop}),
+ code <- Sequence{invokeCb, pop}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{invokeCb, pop}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{invokeCb, pop}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.condition, argcount <- 0), -- [..., cond]
pop : EMFTVM!Pop -- [...]
}
@@ -1092,15 +1093,15 @@
from s : ATL!ForStat in IN
to cb : EMFTVM!CodeBlock (
localVariables <- Sequence{s.iterator},
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{s.collection, loop},
- code <:= Sequence{invokeCb, it, store, invokeCb2, endit}),
+ code <- Sequence{invokeCb, it, store, invokeCb2, endit}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{invokeCb, it, store, invokeCb2, endit}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{invokeCb, it, store, invokeCb2, endit}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.collection, argcount <- 0), -- [..., coll]
it : EMFTVM!Iterate (target <- endit), -- [..., it(coll), value]
store : EMFTVM!Store (localVariable <- s.iterator), -- [..., it(coll)]
@@ -1108,7 +1109,7 @@
endit : EMFTVM!Enditerate (target <- it), -- [...]
loop : EMFTVM!CodeBlock (
nested <- s.statements,
- code <:= Sequence{invokeAllCbs}),
+ code <- Sequence{invokeAllCbs}),
invokeAllCbs : EMFTVM!InvokeAllCbs (argcount <- 0)
}
@@ -1123,14 +1124,14 @@
lazy rule DeleteInPatternElement {
from s : ATL!InPatternElement
to cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
- code <:= Sequence{load, delete}),
+ lineNumbers <- Sequence{ln},
+ code <- Sequence{load, delete}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{load, delete}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{load, delete}),
load : EMFTVM!Load ( -- [..., source]
localVariable <- thisModule.resolveTemp(s, 'ov')),
delete : EMFTVM!Delete -- [...]
@@ -1142,14 +1143,14 @@
lazy rule RemapInPatternElement {
from s : ATL!InPatternElement
to cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
- code <:= Sequence{load, load2, invoke, pop}),
+ lineNumbers <- Sequence{ln},
+ code <- Sequence{load, load2, invoke, pop}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{load, load2, invoke, pop}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{load, load2, invoke, pop}),
load : EMFTVM!Load ( -- [..., source]
localVariable <- thisModule.resolveTemp(s, 'ov')),
load2 : EMFTVM!Load ( -- [..., source, target]
@@ -1166,14 +1167,14 @@
lazy rule LoadPatternElement {
from s : ATL!PatternElement
to cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
- code <:= Sequence{load}),
+ lineNumbers <- Sequence{ln},
+ code <- Sequence{load}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{load}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{load}),
load : EMFTVM!Load ( -- [..., source]
localVariable <- thisModule.resolveTemp(s, 'ov'))
do {
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/ATLtoEMFTVM.emftvm b/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/ATLtoEMFTVM.emftvm
index 501316c..b4ad609 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/ATLtoEMFTVM.emftvm
+++ b/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/ATLtoEMFTVM.emftvm
Binary files differ
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/OCLtoEMFTVM.atl b/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/OCLtoEMFTVM.atl
index 6aa7864..81bb5e5 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/OCLtoEMFTVM.atl
+++ b/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/OCLtoEMFTVM.atl
@@ -142,60 +142,21 @@
helper context ATL!VariableExp def : localVariable() : EMFTVM!LocalVariable =
thisModule.resolveTemp(self.referredVariable, 'lv');
---- Returns a Sequence of the elements from a location string
---- (e.g. Sequence{278, 1, 283, 14} for '278:1-283:14')
-helper context ATL!LocatedElement def : splitLocation : Sequence(String) =
- self.location.split('-|:');
+-- Returns start line from a location string (e.g. 278 for '278:1-283:14')
+helper context String def : startLine : Integer =
+ self.substring(1, self.indexOf(':') - 1).toInteger();
---- Returns start line from a location string (e.g. 278 for '278:1-283:14')
-helper context ATL!LocatedElement def : startLine : Integer =
- self.splitLocation->at(1).toInteger();
+-- Returns start column from a location string (e.g. 1 for '278:1-283:14')
+helper context String def : startColumn : Integer =
+ self.substring(self.indexOf(':') + 1, self.indexOf('-') - 1).toInteger();
---- Returns start column from a location string (e.g. 1 for '278:1-283:14')
-helper context ATL!LocatedElement def : startColumn : Integer =
- self.splitLocation->at(2).toInteger();
+-- Returns end line from a location string (e.g. 283 for '278:1-283:14')
+helper context String def : endLine : Integer =
+ self.substring(self.indexOf('-') + 1, self.lastIndexOf(':') - 1).toInteger();
---- Returns end line from a location string (e.g. 283 for '278:1-283:14')
-helper context ATL!LocatedElement def : endLine : Integer =
- self.splitLocation->at(3).toInteger();
-
---- Returns end column from a location string (e.g. 14 for '278:1-283:14')
-helper context ATL!LocatedElement def : endColumn : Integer =
- self.splitLocation->at(4).toInteger();
-
---- Returns 'true' if this OCL expression is part of a rule's input filter.
-helper context OclAny def : isFilterExpression : Boolean =
- false;
-
---- Returns 'true' if this OCL expression is part of a rule's input filter.
-helper context ATL!OclExpression def : isFilterExpression : Boolean =
- let parent : OclAny = self.refImmediateComposite() in
- (parent.oclIsKindOf(ATL!InPattern) and parent.filter = self)
- or parent.isFilterExpression;
-
---- Returns 'true' if this OCL expression is a rule search plan.
-helper context OclAny def : isSearchPlan : Boolean =
- false;
-
---- Returns 'true' if this OCL expression is a rule search plan.
-helper context ATL!OperationCallExp def : isSearchPlan : Boolean =
- not self.isStatic and (
- (
- (self.operationName = '=' or self.operationName = 'includes') and
- self.arguments->includes(a |
- a.oclIsKindOf(ATL!VariableExp) and a.referredVariable.isMatchedRuleField
- )
- ) or (
- self.operationName = 'and' and
- self.arguments->includes(a |
- a.isSearchPlan
- )
- )
- );
-
---- Returns 'true' if this OCL expression is part of a rule search plan.
-helper context ATL!NavigationOrAttributeCallExp def : isSearchPlanExpression : Boolean =
- not self.isStatic and self.refImmediateComposite().isSearchPlanExpression;
+-- Returns end column from a location string (e.g. 14 for '278:1-283:14')
+helper context String def : endColumn : Integer =
+ self.substring(self.lastIndexOf(':') + 1, self.size()).toInteger();
-- ======================================================================
-- helpers end
@@ -213,20 +174,20 @@
a : ATL!Attribute = s.feature;
}
to t : EMFTVM!Field (
- name <:= a.name,
- type <:= a.type.typeName,
- typeModel <:= a.type.modelName,
- initialiser <:= cb),
+ name <- a.name,
+ type <- a.type.typeName,
+ typeModel <- a.type.modelName,
+ initialiser <- cb),
cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{a.initExpression},
- code <:= Sequence{invokeCb}),
+ code <- Sequence{invokeCb}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{invokeCb}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{invokeCb}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- a.initExpression, argcount <- 0)
}
@@ -247,7 +208,7 @@
"context" <- s.contextType.typeName,
contextModel <- s.contextType.modelName),
cb : EMFTVM!CodeBlock (
- localVariables <:= Sequence{lv}),
+ localVariables <- Sequence{lv}),
lv : EMFTVM!LocalVariable (
name <- 'self',
type <- s.contextType.typeName,
@@ -266,15 +227,15 @@
parameters <- o.parameters,
body <- cb),
cb : EMFTVM!CodeBlock (
- lineNumbers <:= Sequence{ln},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{o.body},
- code <:= Sequence{invokeCb}),
+ code <- Sequence{invokeCb}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{invokeCb}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{invokeCb}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- o.body, argcount <- 0)
}
@@ -301,7 +262,7 @@
"context" <- s.contextType.typeName,
contextModel <- s.contextType.modelName),
cb : EMFTVM!CodeBlock (
- localVariables <:= Sequence{lv}->union(o1.parameters->collect(p|thisModule.resolveTemp(p, 'lv')))),
+ localVariables <- Sequence{lv}->union(o1.parameters->collect(p|thisModule.resolveTemp(p, 'lv')))),
lv : EMFTVM!LocalVariable (
name <- 'self',
type <- s.contextType.typeName,
@@ -311,13 +272,13 @@
rule Parameter {
from s : ATL!Parameter in IN
to t : EMFTVM!Parameter (
- name <:= s.varName,
- type <:= s.type.typeName,
- typeModel <:= s.type.modelName),
+ name <- s.varName,
+ type <- s.type.typeName,
+ typeModel <- s.type.modelName),
lv : EMFTVM!LocalVariable (
- name <:= s.varName,
- type <:= s.type.typeName,
- typeModel <:= s.type.modelName)
+ name <- s.varName,
+ type <- s.type.typeName,
+ typeModel <- s.type.modelName)
}
-------------- VariableDeclarations -----------------
@@ -325,22 +286,22 @@
rule Iterator {
from s : ATL!Iterator in IN
to lv : EMFTVM!LocalVariable (
- name <:= s.varName)
+ name <- s.varName)
}
rule IteratorWithType extends Iterator {
from s : ATL!Iterator in IN (not s.type.oclIsUndefined())
to lv : EMFTVM!LocalVariable (
- type <:= s.type.typeName,
- typeModel <:= s.type.modelName)
+ type <- s.type.typeName,
+ typeModel <- s.type.modelName)
}
rule IterateResult {
from s : ATL!VariableDeclaration in IN (not s.baseExp.oclIsUndefined())
to lv : EMFTVM!LocalVariable (
- name <:= s.varName,
- type <:= s.type.typeName,
- typeModel <:= s.type.modelName)
+ name <- s.varName,
+ type <- s.type.typeName,
+ typeModel <- s.type.modelName)
}
-------------- OclExpressions -----------------
@@ -349,12 +310,12 @@
from s : ATL!OclExpression in IN
to cb : EMFTVM!CodeBlock (
localVariables <- s.parentIterators->union(s.parentAccumulators),
- lineNumbers <:= Sequence{ln}),
+ lineNumbers <- Sequence{ln}),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn)
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn)
}
rule NavigationOrAttributeCallExp extends OclExpression {
@@ -364,9 +325,9 @@
not (s.refImmediateComposite().oclIsKindOf(ATL!BindingStat) and s.refImmediateComposite().source = s))
to cb : EMFTVM!CodeBlock (
nested <- Sequence{s.source},
- code <:= Sequence{invokeCb, get}),
+ code <- Sequence{invokeCb, get}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb, get}),
+ instructions <- Sequence{invokeCb, get}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.source, argcount <- 0), -- [..., result]
get : EMFTVM!Get (fieldname <- s.name) -- [..., value]
}
@@ -377,9 +338,9 @@
not (s.refImmediateComposite().oclIsKindOf(ATL!BindingStat) and s.refImmediateComposite().source = s))
to cb : EMFTVM!CodeBlock (
nested <- Sequence{s.source},
- code <:= Sequence{invokeCb, getStatic}),
+ code <- Sequence{invokeCb, getStatic}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb, getStatic}),
+ instructions <- Sequence{invokeCb, getStatic}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.source, argcount <- 0), -- [..., result]
getStatic : EMFTVM!GetStatic (fieldname <- s.name) -- [..., value]
}
@@ -389,9 +350,9 @@
s.source.oclIsKindOf(ATL!SuperExp))
to cb : EMFTVM!CodeBlock (
nested <- Sequence{s.source},
- code <:= Sequence{invokeCb, getSuper}),
+ code <- Sequence{invokeCb, getSuper}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb, getSuper}),
+ instructions <- Sequence{invokeCb, getSuper}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.source, argcount <- 0), -- [..., result]
getSuper : EMFTVM!GetSuper (fieldname <- s.name) -- [..., value]
}
@@ -408,9 +369,9 @@
s.operationName <> 'oclIsUndefined')
to cb : EMFTVM!CodeBlock (
nested <- s.arguments->prepend(s.source),
- code <:= Sequence{invokeAllCbs, invoke}),
+ code <- Sequence{invokeAllCbs, invoke}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeAllCbs, invoke}),
+ instructions <- Sequence{invokeAllCbs, invoke}),
invokeAllCbs : EMFTVM!InvokeAllCbs, -- [..., source, args]
invoke : EMFTVM!Invoke ( -- [..., result]
opname <- s.operationName,
@@ -422,9 +383,9 @@
not s.isStatic and s.operationName = 'not')
to cb : EMFTVM!CodeBlock (
nested <- s.arguments->prepend(s.source),
- code <:= Sequence{invokeCb, _not}),
+ code <- Sequence{invokeCb, _not}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb, _not}),
+ instructions <- Sequence{invokeCb, _not}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.source, argcount <- 0), -- [..., source]
_not : EMFTVM!Not -- [..., result]
}
@@ -434,9 +395,9 @@
not s.isStatic and s.operationName = 'and')
to cb : EMFTVM!CodeBlock (
nested <- s.arguments->prepend(s.source),
- code <:= Sequence{invokeCb, _and}),
+ code <- Sequence{invokeCb, _and}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb, _and}),
+ instructions <- Sequence{invokeCb, _and}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.source, argcount <- 0), -- [..., source]
_and : EMFTVM!And (codeBlock <- s.arguments->first()) -- [..., result]
}
@@ -446,9 +407,9 @@
not s.isStatic and s.operationName = 'or')
to cb : EMFTVM!CodeBlock (
nested <- s.arguments->prepend(s.source),
- code <:= Sequence{invokeCb, _or}),
+ code <- Sequence{invokeCb, _or}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb, _or}),
+ instructions <- Sequence{invokeCb, _or}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.source, argcount <- 0), -- [..., source]
_or : EMFTVM!Or (codeBlock <- s.arguments->first()) -- [..., result]
}
@@ -458,9 +419,9 @@
not s.isStatic and s.operationName = 'implies')
to cb : EMFTVM!CodeBlock (
nested <- s.arguments->prepend(s.source),
- code <:= Sequence{invokeCb, _implies}),
+ code <- Sequence{invokeCb, _implies}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb, _implies}),
+ instructions <- Sequence{invokeCb, _implies}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.source, argcount <- 0), -- [..., source]
_implies : EMFTVM!Implies (codeBlock <- s.arguments->first()) -- [..., result]
}
@@ -470,9 +431,9 @@
not s.isStatic and s.operationName = 'xor')
to cb : EMFTVM!CodeBlock (
nested <- s.arguments->including(s.source),
- code <:= Sequence{invokeCb, invokeCb2, _xor}),
+ code <- Sequence{invokeCb, invokeCb2, _xor}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb, invokeCb2, _xor}),
+ instructions <- Sequence{invokeCb, invokeCb2, _xor}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.source, argcount <- 0), -- [..., source]
invokeCb2 : EMFTVM!InvokeCb (codeBlock <- s.arguments->first(), argcount <- 0), -- [..., source, arg1]
_xor : EMFTVM!Xor -- [..., result]
@@ -483,9 +444,9 @@
not s.isStatic and s.operationName = 'oclIsUndefined')
to cb : EMFTVM!CodeBlock (
nested <- Sequence{s.source},
- code <:= Sequence{invokeCb, isnull}),
+ code <- Sequence{invokeCb, isnull}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb, isnull}),
+ instructions <- Sequence{invokeCb, isnull}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.source, argcount <- 0), -- [..., source]
isnull : EMFTVM!Isnull -- [..., result]
}
@@ -495,9 +456,9 @@
s.isStatic)
to cb : EMFTVM!CodeBlock (
nested <- s.arguments->prepend(s.source),
- code <:= Sequence{invokeAllCbs, invokeStatic}),
+ code <- Sequence{invokeAllCbs, invokeStatic}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeAllCbs, invokeStatic}),
+ instructions <- Sequence{invokeAllCbs, invokeStatic}),
invokeAllCbs : EMFTVM!InvokeAllCbs, -- [..., type, args]
invokeStatic : EMFTVM!InvokeStatic ( -- [..., result]
opname <- s.operationName,
@@ -510,9 +471,9 @@
s.source.oclIsKindOf(ATL!SuperExp))
to cb : EMFTVM!CodeBlock (
nested <- s.arguments->prepend(s.source),
- code <:= Sequence{invokeAllCbs, invokeSuper}),
+ code <- Sequence{invokeAllCbs, invokeSuper}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeAllCbs, invokeSuper}),
+ instructions <- Sequence{invokeAllCbs, invokeSuper}),
invokeAllCbs : EMFTVM!InvokeAllCbs, -- [..., self, args]
invokeSuper : EMFTVM!InvokeSuper ( -- [..., result]
opname <- s.operationName,
@@ -537,29 +498,29 @@
from s : ATL!LetExp in IN
to cb : EMFTVM!CodeBlock (
nested <- Sequence{s.variable},
- code <:= Sequence{invokeCb}),
+ code <- Sequence{invokeCb}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb}),
+ instructions <- Sequence{invokeCb}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.variable, argcount <- 0) -- [..., result]
}
rule LetVariable {
from s : ATL!VariableDeclaration in IN (not s.letExp.oclIsUndefined())
to cb : EMFTVM!CodeBlock (
- localVariables <:= Sequence{lv},
- lineNumbers <:= Sequence{ln},
+ localVariables <- Sequence{lv},
+ lineNumbers <- Sequence{ln},
nested <- Sequence{s.initExpression, s.letExp.in_},
- code <:= Sequence{invokeCb, store, invokeCb2}),
+ code <- Sequence{invokeCb, store, invokeCb2}),
lv : EMFTVM!LocalVariable (
- name <:= s.varName,
- type <:= s.type.typeName,
- typeModel <:= s.type.modelName),
+ name <- s.varName,
+ type <- s.type.typeName,
+ typeModel <- s.type.modelName),
ln : EMFTVM!LineNumber (
- startLine <:= s.startLine,
- startColumn <:= s.startColumn,
- endLine <:= s.endLine,
- endColumn <:= s.endColumn,
- instructions <:= Sequence{invokeCb, store, invokeCb2}),
+ startLine <- s.location.startLine,
+ startColumn <- s.location.startColumn,
+ endLine <- s.location.endLine,
+ endColumn <- s.location.endColumn,
+ instructions <- Sequence{invokeCb, store, invokeCb2}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.initExpression, argcount <- 0), -- [..., value]
store : EMFTVM!Store (localVariable <- lv), -- [...]
invokeCb2 : EMFTVM!InvokeCb (codeBlock <- s.letExp.in_) -- [..., result]
@@ -571,9 +532,9 @@
not s.referredVariable.isMatchedRuleField and
not (s.refImmediateComposite().oclIsKindOf(ATL!BindingStat) and s.refImmediateComposite().source = s))
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{load}),
+ code <- Sequence{load}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{load}),
+ instructions <- Sequence{load}),
load : EMFTVM!Load -- [..., value]
}
@@ -596,9 +557,9 @@
rule SuperExp extends OclExpression {
from s : ATL!SuperExp in IN
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{load}),
+ code <- Sequence{load}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{load}),
+ instructions <- Sequence{load}),
load : EMFTVM!Load (
localVariable <- thisModule.resolveTemp(s.parentFeatureDef, 'lv'))
}
@@ -608,9 +569,9 @@
s.referredVariable.varName = 'thisModule' and
not s.referredVariable.isMatchedRuleField)
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{getenvtype}),
+ code <- Sequence{getenvtype}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{getenvtype}),
+ instructions <- Sequence{getenvtype}),
getenvtype : EMFTVM!Getenvtype -- [..., envtype]
}
@@ -619,9 +580,9 @@
s.referredVariable.isMatchedRuleField and
not (s.refImmediateComposite().oclIsKindOf(ATL!BindingStat) and s.refImmediateComposite().source = s))
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{load, get}),
+ code <- Sequence{load, get}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{load, get}),
+ instructions <- Sequence{load, get}),
load : EMFTVM!Load (localVariable <- s.traceVariable()), -- [..., trace]
get : EMFTVM!Get (fieldname <- s.referredVariable.varName) -- [..., value]
}
@@ -630,9 +591,9 @@
from s : ATL!IteratorExp in IN
to cb : EMFTVM!CodeBlock (
nested <- Sequence{s.source, s.body},
- code <:= Sequence{invokesource, getbody, invoke}),
+ code <- Sequence{invokesource, getbody, invoke}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokesource, getbody, invoke}),
+ instructions <- Sequence{invokesource, getbody, invoke}),
invokesource : EMFTVM!InvokeCb (codeBlock <- s.source, argcount <- 0), -- [..., source]
getbody : EMFTVM!Getcb (codeBlock <- s.body), -- [..., soure, cb]
invoke : EMFTVM!Invoke (opname <- s.name, argcount <- 1) -- [..., coll]
@@ -648,9 +609,9 @@
from s : ATL!IterateExp in IN
to cb : EMFTVM!CodeBlock (
nested <- Sequence{s.source, s.result.initExpression, s.body},
- code <:= Sequence{invokesource, invokeCb, getbody, invoke}),
+ code <- Sequence{invokesource, invokeCb, getbody, invoke}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokesource, invokeCb, getbody, invoke}),
+ instructions <- Sequence{invokesource, invokeCb, getbody, invoke}),
invokesource : EMFTVM!InvokeCb (codeBlock <- s.source, argcount <- 0), -- [..., source]
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.result.initExpression), -- [..., source, acc]
getbody : EMFTVM!Getcb (codeBlock <- s.body), -- [..., source, acc, cb]
@@ -660,45 +621,45 @@
rule StringExp extends OclExpression {
from s : ATL!StringExp in IN
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{push}),
+ code <- Sequence{push}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{push}),
+ instructions <- Sequence{push}),
push : EMFTVM!Push (value <- s.stringSymbol) -- [..., string]
}
rule IntegerExp extends OclExpression {
from s : ATL!IntegerExp in IN
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{push}),
+ code <- Sequence{push}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{push}),
+ instructions <- Sequence{push}),
push : EMFTVM!Push (value <- s.integerSymbol) -- [..., integer]
}
rule RealExp extends OclExpression {
from s : ATL!RealExp in IN
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{push}),
+ code <- Sequence{push}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{push}),
+ instructions <- Sequence{push}),
push : EMFTVM!Push (value <- s.realSymbol) -- [..., real]
}
rule BooleanTrueExp extends OclExpression {
from s : ATL!BooleanExp in IN (s.booleanSymbol)
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{push}),
+ code <- Sequence{push}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{push}),
+ instructions <- Sequence{push}),
push : EMFTVM!Pusht -- [..., true]
}
rule BooleanFalseExp extends OclExpression {
from s : ATL!BooleanExp in IN (not s.booleanSymbol)
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{push}),
+ code <- Sequence{push}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{push}),
+ instructions <- Sequence{push}),
push : EMFTVM!Pushf -- [..., false]
}
@@ -710,9 +671,9 @@
}
to cb : EMFTVM!CodeBlock (
nested <- s.elements,
- code <:= Sequence{findtype, new}->union(invokes)),
+ code <- Sequence{findtype, new}->union(invokes)),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{findtype, new}->union(invokes)),
+ instructions <- Sequence{findtype, new}->union(invokes)),
findtype : EMFTVM!Findtype, -- override -- [..., colltype]
new : EMFTVM!New -- [..., coll]
}
@@ -749,9 +710,9 @@
}
to cb : EMFTVM!CodeBlock (
nested <- s.elements->collect(e | Sequence{e.key, e.value})->flatten(),
- code <:= Sequence{findtype, new}->union(puts)),
+ code <- Sequence{findtype, new}->union(puts)),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{findtype, new}->union(puts)),
+ instructions <- Sequence{findtype, new}->union(puts)),
findtype : EMFTVM!Findtype ( -- [..., MapImplType]
modelname <- '#native',
typename <- thisModule.MapImplType),
@@ -766,9 +727,9 @@
}
to cb : EMFTVM!CodeBlock (
nested <- s.tuplePart->collect(e | e.initExpression),
- code <:= Sequence{findtype, findtype2, new}->union(puts)->append(invokeFromMap)),
+ code <- Sequence{findtype, findtype2, new}->union(puts)->append(invokeFromMap)),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{findtype, findtype2, new}->union(puts)->append(invokeFromMap)),
+ instructions <- Sequence{findtype, findtype2, new}->union(puts)->append(invokeFromMap)),
findtype : EMFTVM!Findtype ( -- [..., TupleType]
modelname <- '#native',
typename <- thisModule.TupleType_),
@@ -791,9 +752,9 @@
s.tupleTypeAttribute.oclIsUndefined() and -- not used as a tuple element type
s.variableDeclaration.oclIsUndefined()) -- not used as a variable declaration type
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{findtype}),
+ code <- Sequence{findtype}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{findtype}),
+ instructions <- Sequence{findtype}),
findtype : EMFTVM!Findtype ( -- [..., type]
modelname <- s.modelName,
typename <- s.typeName)
@@ -802,18 +763,18 @@
rule OclUndefinedExp extends OclExpression {
from s : ATL!OclUndefinedExp in IN
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{push}),
+ code <- Sequence{push}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{push}),
+ instructions <- Sequence{push}),
push : EMFTVM!Push -- NULL -- [..., null]
}
rule EnumLiteralExp extends OclExpression {
from s : ATL!EnumLiteralExp in IN
to cb : EMFTVM!CodeBlock (
- code <:= Sequence{push}),
+ code <- Sequence{push}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{push}),
+ instructions <- Sequence{push}),
push : EMFTVM!Push (enumValue <- s.name) -- [..., enumValue]
}
@@ -821,9 +782,9 @@
from s : ATL!IfExp in IN
to cb : EMFTVM!CodeBlock (
nested <- Sequence{s.condition, s.thenExpression, s.elseExpression},
- code <:= Sequence{invokeCb, ifte}),
+ code <- Sequence{invokeCb, ifte}),
ln : EMFTVM!LineNumber (
- instructions <:= Sequence{invokeCb, ifte}),
+ instructions <- Sequence{invokeCb, ifte}),
invokeCb : EMFTVM!InvokeCb (codeBlock <- s.condition, argcount <- 0), -- [..., cond]
ifte : EMFTVM!Ifte (thenCb <- s.thenExpression, elseCb <- s.elseExpression) -- [..., result]
}
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/OCLtoEMFTVM.emftvm b/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/OCLtoEMFTVM.emftvm
index c17af74..fbff270 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/OCLtoEMFTVM.emftvm
+++ b/plugins/org.eclipse.m2m.atl.emftvm.compiler/transformations/OCLtoEMFTVM.emftvm
Binary files differ
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.trace/src/org/eclipse/m2m/atl/emftvm/trace/impl/TraceLinkSetImpl.java b/plugins/org.eclipse.m2m.atl.emftvm.trace/src/org/eclipse/m2m/atl/emftvm/trace/impl/TraceLinkSetImpl.java
index 63fc132..044b12d 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm.trace/src/org/eclipse/m2m/atl/emftvm/trace/impl/TraceLinkSetImpl.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm.trace/src/org/eclipse/m2m/atl/emftvm/trace/impl/TraceLinkSetImpl.java
@@ -13,7 +13,6 @@
import java.util.Collection;
import java.util.HashMap;
-import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
@@ -33,7 +32,6 @@
import org.eclipse.m2m.atl.emftvm.trace.TraceLinkSet;
import org.eclipse.m2m.atl.emftvm.trace.TracePackage;
import org.eclipse.m2m.atl.emftvm.trace.TracedRule;
-import org.eclipse.m2m.atl.emftvm.trace.util.IdentityHashList;
/**
@@ -87,17 +85,17 @@
/**
* Lookup table of referred objects to {@link SourceElement}s.
*/
- protected final Map<EObject, SourceElement> defaultSourceObjects = new IdentityHashMap<EObject, SourceElement>();
+ protected final Map<EObject, SourceElement> defaultSourceObjects = new HashMap<EObject, SourceElement>();
/**
* Lookup table of referred objects to {@link SourceElementList}s.
*/
- protected final Map<IdentityHashList<Object>, SourceElementList> defaultSourceObjectLists = new HashMap<IdentityHashList<Object>, SourceElementList>();
+ protected final Map<List<Object>, SourceElementList> defaultSourceObjectLists = new HashMap<List<Object>, SourceElementList>();
/**
* Lookup table of traced rules by name.
*/
- protected final Map<String, TracedRule> linksByRuleName = new IdentityHashMap<String, TracedRule>();
+ protected final Map<String, TracedRule> linksByRuleName = new HashMap<String, TracedRule>();
/**
* <!-- begin-user-doc -->
@@ -170,10 +168,8 @@
* <!-- end-user-doc -->
* @generated NOT
*/
- @SuppressWarnings("unchecked")
public SourceElementList getDefaultSourceElements(final List<?> sourceElements) {
- return defaultSourceObjectLists.get(sourceElements instanceof IdentityHashList<?> ? sourceElements
- : new IdentityHashList<Object>((List<Object>) sourceElements));
+ return defaultSourceObjectLists.get(sourceElements);
}
/**
@@ -454,13 +450,14 @@
*/
private void defaultSourceElementAdded(final SourceElement se) {
final EObject object = se.getObject();
- final SourceElement eSe = defaultSourceObjects.put(object, se);
- if (eSe != null) {
+ if (defaultSourceObjects.containsKey(object)) {
+ final SourceElement eSe = defaultSourceObjects.get(object);
throw new IllegalArgumentException(String.format(
"Default trace already exists for source element %s::%s: %s::%s",
se.getSourceOf().getRule(), se,
eSe.getSourceOf().getRule(), eSe));
}
+ defaultSourceObjects.put(object, se);
}
/**
@@ -477,16 +474,17 @@
*/
private void defaultSourceElementListAdded(final SourceElementList sel) {
final List<Object> objects = sel.getSourceObjects();
- final SourceElementList eSel = defaultSourceObjectLists.put(new IdentityHashList<Object>(objects), sel);
- if (eSel != null) {
+ if (defaultSourceObjectLists.containsKey(objects)) {
assert !sel.getSourceElements().isEmpty();
final TracedRule selRule = sel.getSourceElements().get(0).getSourceOf().getRule();
+ final SourceElementList eSel = defaultSourceObjectLists.get(objects);
assert !eSel.getSourceElements().isEmpty();
final TracedRule eSelRule = eSel.getSourceElements().get(0).getSourceOf().getRule();
throw new IllegalArgumentException(String.format(
"Default trace already exists for source element list %s::%s: %s::%s",
selRule, sel, eSelRule, eSel));
}
+ defaultSourceObjectLists.put(objects, sel);
}
/**
@@ -494,7 +492,7 @@
* @param sel
*/
private void defaultSourceElementListRemoved(final SourceElementList sel) {
- defaultSourceObjectLists.remove(new IdentityHashList<Object>(sel.getSourceObjects()));
+ defaultSourceObjectLists.remove(sel.getSourceObjects());
}
} //TraceLinkSetImpl
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.trace/src/org/eclipse/m2m/atl/emftvm/trace/impl/TracedRuleImpl.java b/plugins/org.eclipse.m2m.atl.emftvm.trace/src/org/eclipse/m2m/atl/emftvm/trace/impl/TracedRuleImpl.java
index 72eb464..182ed8c 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm.trace/src/org/eclipse/m2m/atl/emftvm/trace/impl/TracedRuleImpl.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm.trace/src/org/eclipse/m2m/atl/emftvm/trace/impl/TracedRuleImpl.java
@@ -14,7 +14,6 @@
import java.util.Collection;
import java.util.HashMap;
-import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
@@ -35,7 +34,6 @@
import org.eclipse.m2m.atl.emftvm.trace.TraceLinkSet;
import org.eclipse.m2m.atl.emftvm.trace.TracePackage;
import org.eclipse.m2m.atl.emftvm.trace.TracedRule;
-import org.eclipse.m2m.atl.emftvm.trace.util.IdentityHashList;
/**
* <!-- begin-user-doc -->
@@ -109,12 +107,12 @@
/**
* Lookup table of referred objects to {@link SourceElement}s.
*/
- protected final Map<Object, SourceElement> uniqueSourceObjects = new IdentityHashMap<Object, SourceElement>();
+ protected final Map<Object, SourceElement> uniqueSourceObjects = new HashMap<Object, SourceElement>();
/**
* Lookup table of referred objects to {@link SourceElementList}s.
*/
- protected final Map<IdentityHashList<Object>, SourceElementList> uniqueSourceObjectLists = new HashMap<IdentityHashList<Object>, SourceElementList>();
+ protected final Map<List<Object>, SourceElementList> uniqueSourceObjectLists = new HashMap<List<Object>, SourceElementList>();
/**
* <!-- begin-user-doc -->
@@ -487,13 +485,14 @@
*/
private void uniqueSourceElementAdded(final SourceElement se) {
final Object object = se.getRuntimeObject();
- final SourceElement eSe = uniqueSourceObjects.put(object, se);
- if (eSe != null) {
+ if (uniqueSourceObjects.containsKey(object)) {
+ final SourceElement eSe = uniqueSourceObjects.get(object);
throw new IllegalArgumentException(String.format(
"Unique trace already exists for source element %s::%s: %s::%s",
se.getSourceOf().getRule(), se,
eSe.getSourceOf().getRule(), eSe));
}
+ uniqueSourceObjects.put(object, se);
}
/**
@@ -510,16 +509,17 @@
*/
private void uniqueSourceElementListAdded(final SourceElementList sel) {
final List<Object> objects = sel.getSourceObjects();
- final SourceElementList eSel = uniqueSourceObjectLists.put(new IdentityHashList<Object>(objects), sel);
- if (eSel != null) {
+ if (uniqueSourceObjectLists.containsKey(objects)) {
assert !sel.getSourceElements().isEmpty();
final TracedRule selRule = sel.getSourceElements().get(0).getSourceOf().getRule();
+ final SourceElementList eSel = uniqueSourceObjectLists.get(objects);
assert !eSel.getSourceElements().isEmpty();
final TracedRule eSelRule = eSel.getSourceElements().get(0).getSourceOf().getRule();
throw new IllegalArgumentException(String.format(
"Unique trace already exists for source element list %s::%s: %s::%s",
selRule, sel, eSelRule, eSel));
}
+ uniqueSourceObjectLists.put(objects, sel);
}
/**
@@ -527,7 +527,7 @@
* @param sel
*/
private void uniqueSourceElementListRemoved(final SourceElementList sel) {
- uniqueSourceObjectLists.remove(new IdentityHashList<Object>(sel.getSourceObjects()));
+ uniqueSourceObjectLists.remove(sel.getSourceObjects());
}
} //TracedRuleImpl
diff --git a/plugins/org.eclipse.m2m.atl.emftvm.trace/src/org/eclipse/m2m/atl/emftvm/trace/util/IdentityHashList.java b/plugins/org.eclipse.m2m.atl.emftvm.trace/src/org/eclipse/m2m/atl/emftvm/trace/util/IdentityHashList.java
deleted file mode 100644
index 2021309..0000000
--- a/plugins/org.eclipse.m2m.atl.emftvm.trace/src/org/eclipse/m2m/atl/emftvm/trace/util/IdentityHashList.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2017 Dennis Wagelaar.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Dennis Wagelaar - initial API and
- * implementation and/or initial documentation
- *******************************************************************************/
-package org.eclipse.m2m.atl.emftvm.trace.util;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-/**
- * {@link List} that uses object identity equality and shallow identity hashes
- * for its elements.
- *
- * @author <a href="mailto:dwagelaar@gmail.com">Dennis Wagelaar</a>
- */
-public class IdentityHashList<E> implements List<E> {
-
- private final List<E> inner;
-
- /**
- * Creates a new {@link IdentityHashList}.
- *
- * @param inner
- * the inner {@link List} to delegate to
- */
- public IdentityHashList(final List<E> inner) {
- this.inner = inner;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(final Object o) {
- if (o == this)
- return true;
- if (!(o instanceof List))
- return false;
-
- final ListIterator<E> e1 = listIterator();
- final ListIterator<?> e2 = ((List<?>) o).listIterator();
- while (e1.hasNext() && e2.hasNext()) {
- E o1 = e1.next();
- Object o2 = e2.next();
- if (o1 != o2) {
- return false;
- }
- }
- return !(e1.hasNext() || e2.hasNext());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode() {
- int hashCode = 1;
- final Iterator<E> i = iterator();
- while (i.hasNext()) {
- E obj = i.next();
- hashCode = 31 * hashCode + (obj == null ? 0 : System.identityHashCode(obj));
- }
- return hashCode;
- }
-
- /**
- * {@inheritDoc}
- */
- public int size() {
- return inner.size();
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isEmpty() {
- return inner.isEmpty();
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean contains(Object o) {
- return inner.contains(o);
- }
-
- /**
- * {@inheritDoc}
- */
- public Iterator<E> iterator() {
- return inner.iterator();
- }
-
- /**
- * {@inheritDoc}
- */
- public Object[] toArray() {
- return inner.toArray();
- }
-
- /**
- * {@inheritDoc}
- */
- public <T> T[] toArray(T[] a) {
- return inner.toArray(a);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean add(E o) {
- return inner.add(o);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean remove(Object o) {
- return inner.remove(o);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean containsAll(Collection<?> c) {
- return inner.containsAll(c);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean addAll(Collection<? extends E> c) {
- return inner.addAll(c);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean addAll(int index, Collection<? extends E> c) {
- return inner.addAll(index, c);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean removeAll(Collection<?> c) {
- return inner.removeAll(c);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean retainAll(Collection<?> c) {
- return inner.retainAll(c);
- }
-
- /**
- * {@inheritDoc}
- */
- public void clear() {
- inner.clear();
- }
-
- /**
- * {@inheritDoc}
- */
- public E get(int index) {
- return inner.get(index);
- }
-
- /**
- * {@inheritDoc}
- */
- public E set(int index, E element) {
- return inner.set(index, element);
- }
-
- /**
- * {@inheritDoc}
- */
- public void add(int index, E element) {
- inner.add(index, element);
- }
-
- /**
- * {@inheritDoc}
- */
- public E remove(int index) {
- return inner.remove(index);
- }
-
- /**
- * {@inheritDoc}
- */
- public int indexOf(Object o) {
- return inner.indexOf(o);
- }
-
- /**
- * {@inheritDoc}
- */
- public int lastIndexOf(Object o) {
- return inner.lastIndexOf(o);
- }
-
- /**
- * {@inheritDoc}
- */
- public ListIterator<E> listIterator() {
- return inner.listIterator();
- }
-
- /**
- * {@inheritDoc}
- */
- public ListIterator<E> listIterator(int index) {
- return inner.listIterator(index);
- }
-
- /**
- * {@inheritDoc}
- */
- public List<E> subList(int fromIndex, int toIndex) {
- return inner.subList(fromIndex, toIndex);
- }
-
-}
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/launch/ATLtoEMFTVM.launch b/tests/org.eclipse.m2m.atl.emftvm.tests/launch/ATLtoEMFTVM.launch
index 7637cb2..cf0c292 100644
--- a/tests/org.eclipse.m2m.atl.emftvm.tests/launch/ATLtoEMFTVM.launch
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/launch/ATLtoEMFTVM.launch
@@ -2,7 +2,7 @@
<launchConfiguration type="org.eclipse.m2m.atl.emftvm.launcher.EMFTVMTransformation">
<stringAttribute key="ATL File Name" value="//org.eclipse.m2m.atl.emftvm.compiler/transformations/ATLtoEMFTVM.atl"/>
<booleanAttribute key="Disable JIT compiler" value="false"/>
-<booleanAttribute key="Display Profiling Data" value="true"/>
+<booleanAttribute key="Display Profiling Data" value="false"/>
<booleanAttribute key="Display Timing Data" value="true"/>
<booleanAttribute key="Enable JIT compiler" value="true"/>
<mapAttribute key="Inout Model Options"/>
@@ -18,7 +18,7 @@
<mapAttribute key="Metamodels">
<mapEntry key="ATL" value="http://www.eclipse.org/gmt/2005/ATL"/>
<mapEntry key="EMFTVM" value="http://www.eclipse.org/m2m/atl/2011/EMFTVM"/>
-<mapEntry key="Problem" value="http://www.eclipse.org/gmt/2005/Problem"/>
+<mapEntry key="Problem" value="platform:/plugin/org.eclipse.m2m.atl.common/org/eclipse/m2m/atl/common/resources/Problem.ecore"/>
</mapAttribute>
<stringAttribute key="Module Name" value="ATLtoEMFTVM"/>
<stringAttribute key="Module Path" value="/org.eclipse.m2m.atl.emftvm.compiler/transformations/"/>