1 57 58 package com.sun.org.apache.xerces.internal.impl.dtd.models; 59 60 import com.sun.org.apache.xerces.internal.impl.dtd.XMLContentSpec; 61 62 68 public class CMUniOp extends CMNode 69 { 70 public CMUniOp(int type, CMNode childNode) 74 { 75 super(type); 76 77 if ((type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE) 79 && (type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE) 80 && (type() != XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE)) 81 { 82 throw new RuntimeException ("ImplementationMessages.VAL_UST"); 83 } 84 85 fChild = childNode; 87 } 88 89 90 final CMNode getChild() 94 { 95 return fChild; 96 } 97 98 99 public boolean isNullable() 103 { 104 if (type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE) 109 return fChild.isNullable(); 110 else 111 return true; 112 } 113 114 115 protected void calcFirstPos(CMStateSet toSet) 119 { 120 toSet.setTo(fChild.firstPos()); 122 } 123 124 protected void calcLastPos(CMStateSet toSet) 125 { 126 toSet.setTo(fChild.lastPos()); 128 } 129 130 131 private CMNode fChild; 139 }; 140 141 | Popular Tags |