if_diff/src/idfAst.cxx
//============================================================================
// Constructs and hooks together children.
//============================================================================
Constructs and hooks together children.
Constructs and hooks together children .
idfAstSiblings::idfAstSiblings(astnodeList *list, idfAst *parnt,
      	      	      	       const idfModel &m)
  : first(NULL)
  , hasSubtreeLocation(false)
  , model(&m)
{
  if (list != NULL) {
    int len = list->size();
    idfAst *prev_child = NULL;
    for (int i = 0; i < len; i += 1) {
      astnodeStruct *child_struct = (*list)[i];
      idfAst *child = child_struct != NULL ? new idfAst(child_struct, parnt, m) : NULL;
      if (prev_child != NULL) {
	prev_child->nextSib = child;
      }
      else {
	first = child;
      }
      if (child != NULL) {
	child->prevSib = prev_child;
      }
      prev_child = child;
    }
  }
  determineSubtreeLocation();
}
idfAstSiblings :: idfAstSiblings ( astnodeList * list , idfAst * parnt , const idfModel & m ) : first ( NULL ) , hasSubtreeLocation ( false ) , model ( & m ) { if ( list != NULL ) { int len = list -> size ( ) ; idfAst * prev_child = NULL ; for ( int i = 0 ; i < len ; i += 1 ) { astnodeStruct * child_struct = ( * list ) [ i ] ; idfAst * child = child_struct != NULL ? new idfAst ( child_struct , parnt , m ) : NULL ; if ( prev_child != NULL ) { prev_child -> nextSib = child ; } else { first = child ; } if ( child != NULL ) { child -> prevSib = prev_child ; } prev_child = child ; } } determineSubtreeLocation ( ) ; }
Constructs and hooks together children.
Constructs and hooks together children .
// Construct the corresponding nodes, and hook them together.