org.eclipse.xtext.nodemodel.impl
Class InvariantChecker
java.lang.Object
org.eclipse.xtext.nodemodel.impl.InvariantChecker
public class InvariantChecker
- extends java.lang.Object
- Author:
- Sebastian Zarnekow - Initial contribution and API
- This class is not intended to be subclassed by clients.
- This class is not intended to be subclassed by clients.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InvariantChecker
public InvariantChecker()
checkInvariant
public void checkInvariant(INode node)
throws InvariantChecker.InconsistentNodeModelException
- Assert the invariant of completely build node model.
Checks that every pointer is correct, e.g.
- a parent points to its first child,
- siblings point to the very same parent,
- the offset and length data is in sync, and
- no null fields are present (besides some empty first child pointers).
- Parameters:
node
- an arbitrary node of the complete node model that should be checked.
- Throws:
InvariantChecker.InconsistentNodeModelException
- if the node is part of an inconsistent node tree.
doCheckInvariant
protected void doCheckInvariant(ICompositeNode rootNode)
doCheckCompositeNodeAndReturnTotalLength
protected int doCheckCompositeNodeAndReturnTotalLength(ICompositeNode node,
int startsAt)
doCheckChildNodeAndReturnTotalLength
protected int doCheckChildNodeAndReturnTotalLength(INode child,
ICompositeNode parent,
int startsAt)
doCheckLeafNodeAndReturnLength
protected int doCheckLeafNodeAndReturnLength(ILeafNode leafNode,
int startsAt)