1 16 17 package org.apache.xerces.impl.xs.models; 18 19 import org.apache.xerces.impl.dtd.models.CMNode; 20 import org.apache.xerces.impl.dtd.models.CMStateSet; 21 import org.apache.xerces.impl.xs.XSParticleDecl; 22 23 32 public class XSCMUniOp extends CMNode { 33 public XSCMUniOp(int type, CMNode childNode) { 37 super(type); 38 39 if ((type() != XSParticleDecl.PARTICLE_ZERO_OR_ONE) 41 && (type() != XSParticleDecl.PARTICLE_ZERO_OR_MORE) 42 && (type() != XSParticleDecl.PARTICLE_ONE_OR_MORE)) { 43 throw new RuntimeException ("ImplementationMessages.VAL_UST"); 44 } 45 46 fChild = childNode; 48 } 49 50 51 final CMNode getChild() { 55 return fChild; 56 } 57 58 59 public boolean isNullable() { 63 if (type() == XSParticleDecl.PARTICLE_ONE_OR_MORE) 68 return fChild.isNullable(); 69 else 70 return true; 71 } 72 73 74 protected void calcFirstPos(CMStateSet toSet) { 78 toSet.setTo(fChild.firstPos()); 80 } 81 82 protected void calcLastPos(CMStateSet toSet) { 83 toSet.setTo(fChild.lastPos()); 85 } 86 87 88 private CMNode fChild; 96 } 98 | Popular Tags |