fixed broken serializer tests in Xbase. The problem was that the node

model was not iterated properly.
This commit is contained in:
Moritz Eysholdt 2012-03-09 14:01:30 +01:00
parent 41df70b922
commit 421085e6e3

View file

@ -33,9 +33,9 @@ public class SemanticNodeIterator implements Iterator<Triple<INode, AbstractElem
public SemanticNodeIterator(EObject obj) {
INode start = NodeModelUtils.findActualNodeFor(obj);
if (start != null) {
if (isEObjectNode(start))
start = ((ICompositeNode) start).getFirstChild();
this.next = findNext(start, false);
while (this.next != null && this.next.getThird() == obj)
this.next = findNext(this.next.getFirst(), false);
} else
this.next = null;
}
@ -52,7 +52,7 @@ public class SemanticNodeIterator implements Iterator<Triple<INode, AbstractElem
continue;
}
EObject ge = current.getGrammarElement();
if (isEObjectNode(current))
if (ge instanceof AbstractElement && isEObjectNode(current))
return Tuples.create(current, (AbstractElement) ge, getEObjectNodeEObject(current));
else if (GrammarUtil.isAssigned(ge) && !GrammarUtil.isEObjectRuleCall(ge)) {
if (ge instanceof CrossReference)