org.eclipse.xtext.nodemodel.impl
Class InvariantChecker

java.lang.Object
  extended by 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.

Nested Class Summary
static class InvariantChecker.InconsistentNodeModelException
           
 
Constructor Summary
InvariantChecker()
           
 
Method Summary
 void checkInvariant(INode node)
          Assert the invariant of completely build node model.
protected  int doCheckChildNodeAndReturnTotalLength(INode child, ICompositeNode parent, int startsAt)
           
protected  int doCheckCompositeNodeAndReturnTotalLength(ICompositeNode node, int startsAt)
           
protected  void doCheckInvariant(ICompositeNode rootNode)
           
protected  int doCheckLeafNodeAndReturnLength(ILeafNode leafNode, int startsAt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvariantChecker

public InvariantChecker()
Method Detail

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.

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)