/*
***************************************************************************
-* Copyright (C) 2002-2008 International Business Machines Corporation *
+* Copyright (C) 2002-2016 International Business Machines Corporation *
* and others. All rights reserved. *
***************************************************************************
*/
fLastPos = 0;
fNullable = FALSE;
fLookAheadEnd = FALSE;
+ fRuleRoot = FALSE;
+ fChainIn = FALSE;
fVal = 0;
fPrecedence = precZero;
fLastPos = other.fLastPos;
fNullable = other.fNullable;
fVal = other.fVal;
+ fRuleRoot = FALSE;
+ fChainIn = other.fChainIn;
UErrorCode status = U_ZERO_ERROR;
fFirstPosSet = new UVector(status); // TODO - get a real status from somewhere
fLastPosSet = new UVector(status);
}
}
}
+ n->fRuleRoot = this->fRuleRoot;
+ n->fChainIn = this->fChainIn;
return n;
}
//
//-------------------------------------------------------------------------
#ifdef RBBI_DEBUG
+
+static int32_t serial(const RBBINode *node) {
+ return (node == NULL? -1 : node->fSerialNum);
+}
+
+
void RBBINode::printNode() {
static const char * const nodeTypeNames[] = {
"setRef",
if (this==NULL) {
RBBIDebugPrintf("%10p", (void *)this);
} else {
- RBBIDebugPrintf("%10p %12s %10p %10p %10p %4d %6d %d ",
- (void *)this, nodeTypeNames[fType], (void *)fParent, (void *)fLeftChild, (void *)fRightChild,
- fSerialNum, fFirstPos, fVal);
+ RBBIDebugPrintf("%10p %5d %12s %c%c %5d %5d %5d %6d %d ",
+ (void *)this, fSerialNum, nodeTypeNames[fType], fRuleRoot?'R':' ', fChainIn?'C':' ',
+ serial(fLeftChild), serial(fRightChild), serial(fParent),
+ fFirstPos, fVal);
if (fType == varRef) {
RBBI_DEBUG_printUnicodeString(fText);
}
//
//-------------------------------------------------------------------------
#ifdef RBBI_DEBUG
+void RBBINode::printNodeHeader() {
+ RBBIDebugPrintf(" Address serial type LeftChild RightChild Parent position value\n");
+}
+
void RBBINode::printTree(UBool printHeading) {
if (printHeading) {
- RBBIDebugPrintf( "-------------------------------------------------------------------\n"
- " Address type Parent LeftChild RightChild serial position value\n"
- );
+ printNodeHeader();
}
this->printNode();
if (this != NULL) {