aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/icu/common/rbbitblb.h
diff options
context:
space:
mode:
authormcheshkov <mcheshkov@yandex-team.ru>2022-02-10 16:46:16 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:16 +0300
commit1312621288956f199a5bd5342b0133d4395fa725 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /contrib/libs/icu/common/rbbitblb.h
parente9d19cec64684c9c1e6b0c98297e5b895cf904fe (diff)
downloadydb-1312621288956f199a5bd5342b0133d4395fa725.tar.gz
Restoring authorship annotation for <mcheshkov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/icu/common/rbbitblb.h')
-rw-r--r--contrib/libs/icu/common/rbbitblb.h202
1 files changed, 101 insertions, 101 deletions
diff --git a/contrib/libs/icu/common/rbbitblb.h b/contrib/libs/icu/common/rbbitblb.h
index eff8918f51..c2b574fe1b 100644
--- a/contrib/libs/icu/common/rbbitblb.h
+++ b/contrib/libs/icu/common/rbbitblb.h
@@ -1,4 +1,4 @@
-// © 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
//
// rbbitblb.h
@@ -15,12 +15,12 @@
#define RBBITBLB_H
#include "unicode/utypes.h"
-
-#if !UCONFIG_NO_BREAK_ITERATION
-
+
+#if !UCONFIG_NO_BREAK_ITERATION
+
#include "unicode/uobject.h"
#include "unicode/rbbi.h"
-#include "rbbirb.h"
+#include "rbbirb.h"
#include "rbbinode.h"
@@ -28,7 +28,7 @@ U_NAMESPACE_BEGIN
class RBBIRuleScanner;
class RBBIRuleBuilder;
-class UVector32;
+class UVector32;
//
// class RBBITableBuilder is part of the RBBI rule compiler.
@@ -41,104 +41,104 @@ class UVector32;
class RBBITableBuilder : public UMemory {
public:
- RBBITableBuilder(RBBIRuleBuilder *rb, RBBINode **rootNode, UErrorCode &status);
+ RBBITableBuilder(RBBIRuleBuilder *rb, RBBINode **rootNode, UErrorCode &status);
~RBBITableBuilder();
- void buildForwardTable();
-
- /** Return the runtime size in bytes of the built state table. */
- int32_t getTableSize() const;
-
- /** Fill in the runtime state table. Sufficient memory must exist at the specified location.
- */
- void exportTable(void *where);
-
- /**
- * Find duplicate (redundant) character classes. Begin looking with categories.first.
- * Duplicate, if found are returned in the categories parameter.
- * This is an iterator-like function, used to identify character classes
- * (state table columns) that can be eliminated.
- * @param categories in/out parameter, specifies where to start looking for duplicates,
- * and returns the first pair of duplicates found, if any.
- * @return true if duplicate char classes were found, false otherwise.
- */
- bool findDuplCharClassFrom(IntPair *categories);
-
- /** 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).
- * @return the number of states removed.
- */
- int32_t removeDuplicateStates();
-
- /** Build the safe reverse table from the already-constructed forward table. */
- void buildSafeReverseTable(UErrorCode &status);
-
- /** Return the runtime size in bytes of the built safe reverse state table. */
- int32_t getSafeTableSize() const;
-
- /** Fill in the runtime safe state table. Sufficient memory must exist at the specified location.
- */
- void exportSafeTable(void *where);
-
-
+ void buildForwardTable();
+
+ /** Return the runtime size in bytes of the built state table. */
+ int32_t getTableSize() const;
+
+ /** Fill in the runtime state table. Sufficient memory must exist at the specified location.
+ */
+ void exportTable(void *where);
+
+ /**
+ * Find duplicate (redundant) character classes. Begin looking with categories.first.
+ * Duplicate, if found are returned in the categories parameter.
+ * This is an iterator-like function, used to identify character classes
+ * (state table columns) that can be eliminated.
+ * @param categories in/out parameter, specifies where to start looking for duplicates,
+ * and returns the first pair of duplicates found, if any.
+ * @return true if duplicate char classes were found, false otherwise.
+ */
+ bool findDuplCharClassFrom(IntPair *categories);
+
+ /** 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).
+ * @return the number of states removed.
+ */
+ int32_t removeDuplicateStates();
+
+ /** Build the safe reverse table from the already-constructed forward table. */
+ void buildSafeReverseTable(UErrorCode &status);
+
+ /** Return the runtime size in bytes of the built safe reverse state table. */
+ int32_t getSafeTableSize() const;
+
+ /** Fill in the runtime safe state table. Sufficient memory must exist at the specified location.
+ */
+ void exportSafeTable(void *where);
+
+
private:
void calcNullable(RBBINode *n);
void calcFirstPos(RBBINode *n);
void calcLastPos(RBBINode *n);
void calcFollowPos(RBBINode *n);
- void calcChainedFollowPos(RBBINode *n, RBBINode *endMarkNode);
+ void calcChainedFollowPos(RBBINode *n, RBBINode *endMarkNode);
void bofFixup();
void buildStateTable();
- void mapLookAheadRules();
+ void mapLookAheadRules();
void flagAcceptingStates();
void flagLookAheadStates();
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();
-
+ /**
+ * 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 duplicate (redundant) states, beginning at the specified pair,
- * within this state table. This is an iterator-like function, used to
- * identify states (state table rows) that can be eliminated.
- * @param states in/out parameter, specifies where to start looking for duplicates,
- * and returns the first pair of duplicates found, if any.
- * @return true if duplicate states were found, false otherwise.
- */
- bool findDuplicateState(IntPair *states);
-
- /** Remove a duplicate state.
- * @param duplStates The duplicate states. The first is kept, the second is removed.
- * All references to the second in the state table are retargeted
- * to the first.
- */
- void removeState(IntPair duplStates);
-
- /** Find the next duplicate state in the safe reverse table. An iterator function.
- * @param states in/out parameter, specifies where to start looking for duplicates,
- * and returns the first pair of duplicates found, if any.
- * @return true if a duplicate pair of states was found.
- */
- bool findDuplicateSafeState(IntPair *states);
-
- /** Remove a duplicate state from the safe table.
- * @param duplStates The duplicate states. The first is kept, the second is removed.
- * All references to the second in the state table are retargeted
- * to the first.
- */
- void removeSafeState(IntPair duplStates);
-
+ /**
+ * Find duplicate (redundant) states, beginning at the specified pair,
+ * within this state table. This is an iterator-like function, used to
+ * identify states (state table rows) that can be eliminated.
+ * @param states in/out parameter, specifies where to start looking for duplicates,
+ * and returns the first pair of duplicates found, if any.
+ * @return true if duplicate states were found, false otherwise.
+ */
+ bool findDuplicateState(IntPair *states);
+
+ /** Remove a duplicate state.
+ * @param duplStates The duplicate states. The first is kept, the second is removed.
+ * All references to the second in the state table are retargeted
+ * to the first.
+ */
+ void removeState(IntPair duplStates);
+
+ /** Find the next duplicate state in the safe reverse table. An iterator function.
+ * @param states in/out parameter, specifies where to start looking for duplicates,
+ * and returns the first pair of duplicates found, if any.
+ * @return true if a duplicate pair of states was found.
+ */
+ bool findDuplicateSafeState(IntPair *states);
+
+ /** Remove a duplicate state from the safe table.
+ * @param duplStates The duplicate states. The first is kept, the second is removed.
+ * All references to the second in the state table are retargeted
+ * to the first.
+ */
+ void removeSafeState(IntPair duplStates);
+
// Set functions for UVector.
// TODO: make a USet subclass of UVector
@@ -153,13 +153,13 @@ public:
void printPosSets(RBBINode *n /* = NULL*/);
void printStates();
void printRuleStatusTable();
- void printReverseTable();
+ void printReverseTable();
#else
#define printSet(s)
#define printPosSets(n)
#define printStates()
#define printRuleStatusTable()
- #define printReverseTable()
+ #define printReverseTable()
#endif
private:
@@ -168,18 +168,18 @@ private:
// table for.
UErrorCode *fStatus;
- /** State Descriptors, UVector<RBBIStateDescriptor> */
+ /** State Descriptors, UVector<RBBIStateDescriptor> */
UVector *fDStates; // D states (Aho's terminology)
// Index is state number
// Contents are RBBIStateDescriptor pointers.
- /** Synthesized safe table, UVector of UnicodeString, one string per table row. */
- UVector *fSafeTable;
+ /** Synthesized safe table, UVector of UnicodeString, one string per table row. */
+ UVector *fSafeTable;
+
+ /** Map from rule number (fVal in look ahead nodes) to sequential lookahead index. */
+ UVector32 *fLookAheadRuleMap = nullptr;
+
- /** Map from rule number (fVal in look ahead nodes) to sequential lookahead index. */
- UVector32 *fLookAheadRuleMap = nullptr;
-
-
RBBITableBuilder(const RBBITableBuilder &other); // forbid copying of this class
RBBITableBuilder &operator=(const RBBITableBuilder &other); // forbid copying of this class
};
@@ -198,7 +198,7 @@ public:
// with this state. Unordered (it's a set).
// UVector contents are RBBINode *
- UVector32 *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
@@ -214,7 +214,7 @@ private:
U_NAMESPACE_END
-
-#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
-
+
+#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
+
#endif