1 package org.apache.oro.text.awk; 2 3 59 60 import java.util.*; 61 62 66 class CharacterClassNode extends LeafNode { 67 BitSet _characterSet; 68 69 CharacterClassNode(int position) { 70 super(position); 71 _characterSet = new BitSet(LeafNode._NUM_TOKENS + 1); 72 } 73 74 void _addToken(int token) { _characterSet.set(token); } 75 76 void _addTokenRange(int min, int max) { 77 while(min <= max) 78 _characterSet.set(min++); 79 } 80 81 boolean _matches(char token) { return _characterSet.get(token); } 82 83 SyntaxNode _clone(int pos[]) { 84 CharacterClassNode node; 85 86 node = new CharacterClassNode(pos[0]++); 87 node._characterSet = (BitSet)_characterSet.clone(); 88 return node; 89 } 90 } 91 | Popular Tags |