예제 #1
0
 protected void calcLastPos(CMStateSet toSet) {
   if (type() == XSModelGroupImpl.MODELGROUP_CHOICE) {
     // Its the the union of the first positions of our children.
     toSet.setTo(fLeftChild.lastPos());
     toSet.union(fRightChild.lastPos());
   } else if (type() == XSModelGroupImpl.MODELGROUP_SEQUENCE) {
     //
     //  If our right child is nullable, then its the union of our
     //  children's last positions. Else is our right child's last
     //  positions.
     //
     toSet.setTo(fRightChild.lastPos());
     if (fRightChild.isNullable()) toSet.union(fLeftChild.lastPos());
   } else {
     throw new RuntimeException("ImplementationMessages.VAL_BST");
   }
 }