summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu/icu-src/source/common/rbbitblb.h
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/icu/icu-src/source/common/rbbitblb.h')
-rw-r--r--Build/source/libs/icu/icu-src/source/common/rbbitblb.h45
1 files changed, 41 insertions, 4 deletions
diff --git a/Build/source/libs/icu/icu-src/source/common/rbbitblb.h b/Build/source/libs/icu/icu-src/source/common/rbbitblb.h
index 10415018785..09b57b5cf0f 100644
--- a/Build/source/libs/icu/icu-src/source/common/rbbitblb.h
+++ b/Build/source/libs/icu/icu-src/source/common/rbbitblb.h
@@ -24,6 +24,7 @@ U_NAMESPACE_BEGIN
class RBBIRuleScanner;
class RBBIRuleBuilder;
+class UVector32;
//
// class RBBITableBuilder is part of the RBBI rule compiler.
@@ -42,9 +43,24 @@ public:
void build();
int32_t getTableSize() const; // Return the runtime size in bytes of
// the built state table
- void exportTable(void *where); // fill in the runtime state table.
- // Sufficient memory must exist at
- // the specified location.
+
+ /** Fill in the runtime state table. Sufficient memory must exist at the specified location.
+ */
+ void exportTable(void *where);
+
+ /** Find duplicate (redundant) character classes, beginning after the specifed
+ * pair, within this state table. This is an iterator-like function, used to
+ * identify char classes (state table columns) that can be eliminated.
+ */
+ bool findDuplCharClassFrom(int &baseClass, int &duplClass);
+
+ /** Remove a column from the state table. Used when two character categories
+ * have been found equivalent, and merged together, to eliminate the uneeded table column.
+ */
+ void removeColumn(int32_t column);
+
+ /** Check for, and remove dupicate states (table rows). */
+ void removeDuplicateStates();
private:
@@ -60,8 +76,29 @@ private:
void flagTaggedStates();
void mergeRuleStatusVals();
+ /**
+ * Merge redundant state table columns, eliminating character classes with identical behavior.
+ * Done after the state tables are generated, just before converting to their run-time format.
+ */
+ int32_t mergeColumns();
+
void addRuleRootNodes(UVector *dest, RBBINode *node);
+ /** Find the next duplicate state. An iterator function.
+ * @param firstState (in/out) begin looking at this state, return the first of the
+ * pair of duplicates.
+ * @param duplicateState returns the duplicate state of fistState
+ * @return true if a duplicate pair of states was found.
+ */
+ bool findDuplicateState(int32_t &firstState, int32_t &duplicateState);
+
+ /** Remove a duplicate state/
+ * @param keepState First of the duplicate pair. Keep it.
+ * @param duplState Duplicate state. Remove it. Redirect all references to the duplicate state
+ * to refer to keepState instead.
+ */
+ void removeState(int32_t keepState, int32_t duplState);
+
// Set functions for UVector.
// TODO: make a USet subclass of UVector
@@ -112,7 +149,7 @@ public:
// with this state. Unordered (it's a set).
// UVector contents are RBBINode *
- UVector *fDtran; // Transitions out of this state.
+ UVector32 *fDtran; // Transitions out of this state.
// indexed by input character
// contents is int index of dest state
// in RBBITableBuilder.fDStates