// file: tr_lxt_tree_2.cc
//
// function to count number of lex nodes in a tree
//

// isip include files
//
#include "train_lex_tree.h"
#include "train_lex_tree_constants.h"

// method: num_lexnodes_cc
//
// arguments: none
//
// return: an int_4 with number of nodes
//
// this method loops through all the children of the input node and
// counts the number of lexical nodes at all the lower levels
//
int_4 Train_Lex_tree::num_lexnodes_cc() {

  // number to count
  //
  int_4 numlx = (int_4)0;

  // if this is a valid tree
  //
  if (head_d != (Train_Lex_node*)NULL) {
    numlx = head_d->num_nodes_cc();
  }
  
  // return gracefully
  //
  return numlx;
}
