Lines Matching +full:stable +full:- +full:branch
5 * Copyright (C) 2010-2012, International Business Machines
9 * encoding: UTF-8
43 * Light-weight, non-const reader class for a BytesTrie.
44 * Traverses a byte-serialized data structure with minimal state,
45 * for mapping byte sequences to non-negative integer values.
53 * @stable ICU 4.8
69 * @stable ICU 4.8
73 pos_(bytes_), remainingMatchLength_(-1) {} in BytesTrie()
77 * @stable ICU 4.8
85 * @stable ICU 4.8
94 * @stable ICU 4.8
98 remainingMatchLength_=-1; in reset()
103 * Returns the state of this trie as a 64-bit integer.
108 * @stable ICU 65
112 static_cast<uint64_t>(pos_ - bytes_); in getState64()
117 * Unlike resetToState(State), the 64-bit state value
127 * @stable ICU 65
130 remainingMatchLength_ = static_cast<int32_t>(state >> kState64RemainingShift) - 2; in resetToState64()
138 * @stable ICU 4.8
144 * @stable ICU 4.8
160 * @stable ICU 4.8
177 * @stable ICU 4.8
191 * @stable ICU 4.8
198 * @param inByte Input byte value. Values -0x100..-1 are treated like 0..0xff.
199 * Values below -0x100 and above 0xff will never match.
201 * @stable ICU 4.8
204 remainingMatchLength_=-1; in first()
213 * @param inByte Input byte value. Values -0x100..-1 are treated like 0..0xff.
214 * Values below -0x100 and above 0xff will never match.
216 * @stable ICU 4.8
231 * @param length The length of the byte sequence. Can be -1 if NUL-terminated.
233 * @stable ICU 4.8
244 * @stable ICU 4.8
257 * (output-only)
260 * @stable ICU 4.8
264 // Skip the rest of a pending linear-match node. in hasUniqueValue()
274 * @stable ICU 4.8
280 * @stable ICU 4.8
285 * Iterates from the root of a byte-serialized BytesTrie.
293 * @stable ICU 4.8
306 * @stable ICU 4.8
312 * @stable ICU 4.8
319 * @stable ICU 4.8
325 * @stable ICU 4.8
333 * have a real value, then the value is set to -1.
335 * a real value of -1.
341 * @stable ICU 4.8
346 * @return The NUL-terminated byte sequence for the last successful next().
347 * @stable ICU 4.8
352 * @stable ICU 4.8
372 // outbound edge of a branch node.
374 // The second integer has the str_->length() from before the node in bits 15..0,
375 // and the remaining branch length in bits 24..16. (Bits 31..25 are unused.)
376 … // (We could store the remaining branch length minus 1 in bits 23..16 and not use bits 31..24,
394 pos_(bytes_), remainingMatchLength_(-1) {} in BytesTrie()
403 // Reads a compact 32-bit integer.
442 … return static_cast<UStringTrieResult>(USTRINGTRIE_INTERMEDIATE_VALUE - (node & kValueIsFinal)); in valueResult()
445 // Handles a branch node for both next(byte) and next(string).
453 // from a branch.
461 // getNextBytes() when pos is on a branch node.
467 // The trie consists of a series of byte-serialized nodes for incremental
471 // After each node, except a final-value node, another node follows to
475 // - Value node: Stores a 32-bit integer in a compact, variable-length format.
479 // - Linear-match node: Matches a number of bytes.
480 // - Branch node: Branches to other nodes according to the current input byte.
481 // The node byte is the length of the branch (number of bytes to select from)
482 // minus 1. It is followed by a sub-node:
483 // - If the length is at most kMaxBranchLinearSubNodeLength, then
484 // there are length-1 (key, value) pairs and then one more comparison byte.
489 // - If the length is greater than kMaxBranchLinearSubNodeLength, then
491 // If the input byte is less than the sub-node byte, then "jump" by delta to
492 // the next sub-node which will have a length of length/2.
494 // Otherwise, skip the "jump" delta to the next sub-node
495 // which will have a length of length-length/2.
499 // 00..0f: Branch node. If node!=0 then the length is node+1, otherwise
502 // For a branch sub-node with at most this many entries, we drop down
506 // 10..1f: Linear-match node, match 1..16 bytes and continue reading the next node.
510 // 20..ff: Variable-length value node.
512 // Then shift-right by 1 bit.
530 static const int32_t kMaxThreeByteValue=((kFourByteValueLead-kMinThreeByteValueLead)<<16)-1;
541 …static const int32_t kMaxTwoByteDelta=((kMinThreeByteDeltaLead-kMinTwoByteDeltaLead)<<8)-1; // 0x…
542 …static const int32_t kMaxThreeByteDelta=((kFourByteDeltaLead-kMinThreeByteDeltaLead)<<16)-1; // 0…
545 // The remainingMatchLength_ is -1..14=(kMaxLinearMatchLength=0x10)-2
549 static constexpr uint64_t kState64PosMask = (UINT64_C(1) << kState64RemainingShift) - 1;
560 // Remaining length of a linear-match node, minus 1. Negative if not in such a node.