1 57 58 package com.sun.org.apache.xerces.internal.impl.xs.models; 59 60 import com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode; 61 import com.sun.org.apache.xerces.internal.impl.dtd.models.CMStateSet; 62 import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl; 63 64 71 public class XSCMUniOp extends CMNode { 72 public XSCMUniOp(int type, CMNode childNode) { 76 super(type); 77 78 if ((type() != XSParticleDecl.PARTICLE_ZERO_OR_ONE) 80 && (type() != XSParticleDecl.PARTICLE_ZERO_OR_MORE) 81 && (type() != XSParticleDecl.PARTICLE_ONE_OR_MORE)) { 82 throw new RuntimeException ("ImplementationMessages.VAL_UST"); 83 } 84 85 fChild = childNode; 87 } 88 89 90 final CMNode getChild() { 94 return fChild; 95 } 96 97 98 public boolean isNullable() { 102 if (type() == XSParticleDecl.PARTICLE_ONE_OR_MORE) 107 return fChild.isNullable(); 108 else 109 return true; 110 } 111 112 113 protected void calcFirstPos(CMStateSet toSet) { 117 toSet.setTo(fChild.firstPos()); 119 } 120 121 protected void calcLastPos(CMStateSet toSet) { 122 toSet.setTo(fChild.lastPos()); 124 } 125 126 127 private CMNode fChild; 135 } 137 | Popular Tags |