src/Chinese/propositions/ch_SemTreeBuilder.cpp
// If you add extra return statements, please decrement analyzeChildrenStackDepth before returning.

If you add extra return statements, please decrement analyzeChildrenStackDepth before returning.
If you add extra return statements please decrement analyzeChildrenStackDepth before returning .
SemNode *ChineseSemTreeBuilder::analyzeChildren(const SynNode *synNode, const MentionSet *mentionSet) {
    if (synNode->isTerminal()) {
        return 0;
    }
	SemNode *firstResult = 0;
	SemNode *lastResult = 0;
	for (int i = 0; i < synNode->getNChildren(); i++) {
		SemNode *result = buildSemSubtree(synNode->getChild(i), mentionSet);
		if (lastResult) {
			lastResult->setNext(result);
		}
		else {
			firstResult = result;
			lastResult = result;
		}
		if (lastResult) {
			while (lastResult->getNext() != 0)
				lastResult = lastResult->getNext();
		}
	}
	return firstResult;
}
SemNode * ChineseSemTreeBuilder :: analyzeChildren ( const SynNode * synNode , const MentionSet * mentionSet ) { if ( synNode -> isTerminal ( ) ) { return 0 ; } SemNode * firstResult = 0 ; SemNode * lastResult = 0 ; for ( int i = 0 ; i < synNode -> getNChildren ( ) ; i ++ ) { SemNode * result = buildSemSubtree ( synNode -> getChild ( i ) , mentionSet ) ; if ( lastResult ) { lastResult -> setNext ( result ) ; } else { firstResult = result ; lastResult = result ; } if ( lastResult ) { while ( lastResult -> getNext ( ) != 0 ) lastResult = lastResult -> getNext ( ) ; } } return firstResult ; }
If you add extra return statements, please decrement analyzeChildrenStackDepth before returning.
If you add extra return statements please decrement analyzeChildrenStackDepth before returning .
//analyzeChildrenStackDepth++;
 // Check if we have gone too deep
 //if (analyzeChildrenStackDepth > 25) {
 //    throw InternalInconsistencyException(
 //        "ChineseSemTreeBuilder::analyzeChildren()",
 //        "analyzeChildrenStackDepth got too big - terminating now before stack overflow");
 //}
 //if (analyzeChildrenStackDepth > maxAnalyzeChildrenStackDepth) { 
 //    maxAnalyzeChildrenStackDepth = analyzeChildrenStackDepth;
 //}
 //    analyzeChildrenStackDepth--;
 // append the linked list returned by buildSemTree to our result list
 //		std::cout << "--\n" << *result << "\n";
 //analyzeChildrenStackDepth--;
