model_server/lde/src/lde_smt_flowchart.cxx
// 
// ------------------  FILE ------------------------------
//
// builds   ldr for a file that may contain fdecls, classes , etc.;
// creates a box for each fdef and cdecl.
FILE
builds   ldr for a file that may contain fdecls, classes , etc.;
creates a box for each fdef and cdecl.
FILE builds ldr for a file that may contain fdecls classes etc . ; creates a box for each fdef and cdecl .
ldrChartNodePtr build_file(smtTreePtr smt_file, int level)
{
   ldrChartNodePtr   ldr_root  = db_new (ldrChartNode, (ldrFLOW_EMPTY));
   ldrChartNodePtr   ldr_prev;
   ldrChartNodePtr   ldr_node;
   Initialize(build_file);
   ldr_prev = NULL;
   if (smt_file == NULL)
       return(NULL);
   ldr_root->set_appTree(smt_file);
   smtTreePtr smt_node = smt_file->get_first();
   while( smt_node != NULL )
   {
      int smt_type = smt_node->type;
      if (smt_type == SMT_fdef || smt_type == SMT_cdecl){
          ldr_node = lde_build_smt_flowchart(smt_node, level+1);
          if (ldr_node != NULL){            
              if (ldr_prev == NULL)
                  ldr_root->put_first(ldr_node);
              else
                  ldr_prev->put_after(ldr_node);
              ldr_prev = ldr_node;
          }
       }
       smt_node = smt_node->get_next();
   }
   return(ldr_root);
}
ldrChartNodePtr build_file ( smtTreePtr smt_file , int level ) { ldrChartNodePtr ldr_root = db_new ( ldrChartNode , ( ldrFLOW_EMPTY ) ) ; ldrChartNodePtr ldr_prev ; ldrChartNodePtr ldr_node ; Initialize ( build_file ) ; ldr_prev = NULL ; if ( smt_file == NULL ) return ( NULL ) ; ldr_root -> set_appTree ( smt_file ) ; smtTreePtr smt_node = smt_file -> get_first ( ) ; while ( smt_node != NULL ) { int smt_type = smt_node -> type ; if ( smt_type == SMT_fdef || smt_type == SMT_cdecl ) { ldr_node = lde_build_smt_flowchart ( smt_node , level + 1 ) ; if ( ldr_node != NULL ) { if ( ldr_prev == NULL ) ldr_root -> put_first ( ldr_node ) ; else ldr_prev -> put_after ( ldr_node ) ; ldr_prev = ldr_node ; } } smt_node = smt_node -> get_next ( ) ; } return ( ldr_root ) ; }
FILE
builds   ldr for a file that may contain fdecls, classes , etc.
FILE builds ldr for a file that may contain fdecls classes etc .
//------  Executable code ---------------------- // dive inside file //    filter smt nodes processing only FDEF and CLASS types // skip comments, etc.