X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b75a7d8f3b4adbae880cab104ce2c6a50eee4db2..c5116b9f5a666b9d59f443b3770acd6ef64dc6c3:/icuSources/common/rbbinode.h diff --git a/icuSources/common/rbbinode.h b/icuSources/common/rbbinode.h index 6d226f7d..f3525960 100644 --- a/icuSources/common/rbbinode.h +++ b/icuSources/common/rbbinode.h @@ -1,6 +1,8 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: - * Copyright (c) 2001-2002, International Business Machines Corporation and + * Copyright (c) 2001-2016, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ @@ -8,6 +10,7 @@ #define RBBINODE_H #include "unicode/utypes.h" +#include "unicode/unistr.h" #include "unicode/uobject.h" // @@ -79,6 +82,10 @@ class RBBINode : public UMemory { UBool fLookAheadEnd; // For endMark nodes, set TRUE if // marking the end of a look-ahead rule. + UBool fRuleRoot; // True if this node is the root of a rule. + UBool fChainIn; // True if chaining into this rule is allowed + // (no '^' present). + UVector *fFirstPosSet; UVector *fLastPosSet; // TODO: rename fFirstPos & fLastPos to avoid confusion. UVector *fFollowPos; @@ -93,17 +100,27 @@ class RBBINode : public UMemory { void flattenSets(); void findNodes(UVector *dest, RBBINode::NodeType kind, UErrorCode &status); - void print(); - void printTree(UBool withHeading=TRUE, UBool doVars=FALSE); - static void printUnicodeString(const UnicodeString &s, int minWidth=0); +#ifdef RBBI_DEBUG + static void printNodeHeader(); + static void printNode(const RBBINode *n); + static void printTree(const RBBINode *n, UBool withHeading); +#endif private: RBBINode &operator = (const RBBINode &other); // No defs. UBool operator == (const RBBINode &other); // Private, so these functions won't accidently be used. +#ifdef RBBI_DEBUG + public: int fSerialNum; // Debugging aids. - static int gLastSerial; +#endif }; + +#ifdef RBBI_DEBUG +U_CFUNC void +RBBI_DEBUG_printUnicodeString(const UnicodeString &s, int minWidth=0); +#endif + U_NAMESPACE_END #endif