Lines Matching full:classes
3 /// A representation of byte oriented equivalence classes.
12 /// Creates a new set of equivalence classes where all bytes are mapped to
18 /// Creates a new set of equivalence classes where each byte belongs to
21 let mut classes = ByteClasses::empty(); in singletons() localVariable
23 classes.set(i as u8, i as u8); in singletons()
25 classes in singletons()
28 /// Copies the byte classes given. The given slice must have length 0 or
37 let mut classes = ByteClasses::empty(); in from_slice() localVariable
39 classes.set(b as u8, class); in from_slice()
41 classes in from_slice()
65 /// these equivalence classes. Equivalently, this returns the total number
66 /// of equivalence classes.
73 /// equivalence class. Equivalently, there are 256 equivalence classes
82 /// equivalent to the number of equivalence classes. Each item is an
86 /// hasn't been converted to equivalence classes yet. Picking an arbitrary
91 ByteClassRepresentatives { classes: self, byte: 0, last_class: None } in representatives()
129 classes: &'a ByteClasses, field
141 let class = self.classes.get(byte); in next()
153 /// A byte class set keeps track of an *approximation* of equivalence classes
163 /// classes. For example, in the regex `[ac]+`, both `a` and `c` are in the
166 /// implementation, `a` and `c` are put into distinct equivalence classes.
168 /// endeavor to compute the minimal equivalence classes since they can have a
179 /// the true minimal set of equivalence classes.
186 /// Create a new set of byte classes where all bytes are part of the same
206 let mut classes = ByteClasses::empty(); in byte_classes() localVariable
210 classes.set(i as u8, class as u8); in byte_classes()
219 classes in byte_classes()
233 let classes = set.byte_classes(); in byte_classes() localVariable
234 assert_eq!(classes.get(0), 0); in byte_classes()
235 assert_eq!(classes.get(1), 0); in byte_classes()
236 assert_eq!(classes.get(2), 0); in byte_classes()
237 assert_eq!(classes.get(b'a' - 1), 0); in byte_classes()
238 assert_eq!(classes.get(b'a'), 1); in byte_classes()
239 assert_eq!(classes.get(b'm'), 1); in byte_classes()
240 assert_eq!(classes.get(b'z'), 1); in byte_classes()
241 assert_eq!(classes.get(b'z' + 1), 2); in byte_classes()
242 assert_eq!(classes.get(254), 2); in byte_classes()
243 assert_eq!(classes.get(255), 2); in byte_classes()
248 let classes = set.byte_classes(); in byte_classes() localVariable
249 assert_eq!(classes.get(0), 0); in byte_classes()
250 assert_eq!(classes.get(1), 0); in byte_classes()
251 assert_eq!(classes.get(2), 0); in byte_classes()
252 assert_eq!(classes.get(3), 1); in byte_classes()
253 assert_eq!(classes.get(4), 2); in byte_classes()
254 assert_eq!(classes.get(5), 2); in byte_classes()
255 assert_eq!(classes.get(6), 2); in byte_classes()
256 assert_eq!(classes.get(7), 3); in byte_classes()
257 assert_eq!(classes.get(255), 3); in byte_classes()