1 16 17 package org.apache.xerces.impl.dtd.models; 18 19 import org.apache.xerces.impl.dtd.XMLContentSpec; 20 21 28 public class CMUniOp extends CMNode 29 { 30 public CMUniOp(int type, CMNode childNode) 34 { 35 super(type); 36 37 if ((type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE) 39 && (type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE) 40 && (type() != XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE)) 41 { 42 throw new RuntimeException ("ImplementationMessages.VAL_UST"); 43 } 44 45 fChild = childNode; 47 } 48 49 50 final CMNode getChild() 54 { 55 return fChild; 56 } 57 58 59 public boolean isNullable() 63 { 64 if (type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE) 69 return fChild.isNullable(); 70 else 71 return true; 72 } 73 74 75 protected void calcFirstPos(CMStateSet toSet) 79 { 80 toSet.setTo(fChild.firstPos()); 82 } 83 84 protected void calcLastPos(CMStateSet toSet) 85 { 86 toSet.setTo(fChild.lastPos()); 88 } 89 90 91 private CMNode fChild; 99 }; 100 101 | Popular Tags |