model_server/lde/src/lde_smt_flowchart.cxx
// Top Level flowchart builder. It either dispatches to type
// specific builder or, if none is found, returns NULL.
Top Level flowchart builder. It either dispatches to type
specific builder or, if none is found, returns NULL.
Top Level flowchart builder . It either dispatches to type specific builder or if none is found returns NULL .
ldrChartNodePtr lde_build_smt_flowchart ( smtTreePtr root, int level)
{
   Initialize(lde_build_smt_flowchart);
   Assert(root);
   ldrChartNodePtr      new_ldr = NULL;
   int is_stmt = 0;
   switch (root->type) {
            case SMT_fdecl:
	    case SMT_fdef:
                 new_ldr = build_fdecl(root, level);
                 break;
            case SMT_if :  
                 new_ldr = build_if_ldr (root, level);
                 is_stmt = 1;
                 break;
            case SMT_nstdloop:
            case SMT_for:
            case SMT_while:
            case SMT_do:
            case SMT_dowhile:
                 new_ldr = build_loop_ldr (root, level);
                 is_stmt = 1;
                 break;
            case SMT_block:
                 new_ldr = build_block_ldr(root, level);
                 is_stmt = 1;
                 break;
            case SMT_break:
                 new_ldr = build_simple_node(root, level,
                                 ldrBULLET, ldrBREAK);
                 break;
            case SMT_label:
                 new_ldr = build_simple_node(root, level, 
                                 ldrFLOW_LABEL, ldrLABEL);
                 break;
            case SMT_goto:
                 new_ldr = build_goto(root, level);
                 break;
            case SMT_file:
                 new_ldr = build_file(root, level);
                 break;
            case SMT_switch:
                 new_ldr = build_switch(root, level);
                 break;
            case SMT_cdecl:
                 new_ldr = build_class(root, level);
                 break;
            case SMT_comment:
            case SMT_null:
            case SMT_token:
            case SMT_group:
                 break;
            case SMT_stmt:
            case SMT_macrostmt:
            case SMT_macrocall:
                 new_ldr = build_stmt (root, level);
                 break;
            default:
                 new_ldr = build_simple_node(root, level, 
                                 ldrBULLET, ldrSIMPLE);
   }
   if(is_stmt && !new_ldr)
                 new_ldr = build_stmt (root, level);       
   return new_ldr;
}
ldrChartNodePtr lde_build_smt_flowchart ( smtTreePtr root , int level ) { Initialize ( lde_build_smt_flowchart ) ; Assert ( root ) ; ldrChartNodePtr new_ldr = NULL ; int is_stmt = 0 ; switch ( root -> type ) { case SMT_fdecl : case SMT_fdef : new_ldr = build_fdecl ( root , level ) ; break ; case SMT_if : new_ldr = build_if_ldr ( root , level ) ; is_stmt = 1 ; break ; case SMT_nstdloop : case SMT_for : case SMT_while : case SMT_do : case SMT_dowhile : new_ldr = build_loop_ldr ( root , level ) ; is_stmt = 1 ; break ; case SMT_block : new_ldr = build_block_ldr ( root , level ) ; is_stmt = 1 ; break ; case SMT_break : new_ldr = build_simple_node ( root , level , ldrBULLET , ldrBREAK ) ; break ; case SMT_label : new_ldr = build_simple_node ( root , level , ldrFLOW_LABEL , ldrLABEL ) ; break ; case SMT_goto : new_ldr = build_goto ( root , level ) ; break ; case SMT_file : new_ldr = build_file ( root , level ) ; break ; case SMT_switch : new_ldr = build_switch ( root , level ) ; break ; case SMT_cdecl : new_ldr = build_class ( root , level ) ; break ; case SMT_comment : case SMT_null : case SMT_token : case SMT_group : break ; case SMT_stmt : case SMT_macrostmt : case SMT_macrocall : new_ldr = build_stmt ( root , level ) ; break ; default : new_ldr = build_simple_node ( root , level , ldrBULLET , ldrSIMPLE ) ; } if ( is_stmt && ! new_ldr ) new_ldr = build_stmt ( root , level ) ; return new_ldr ; }
Top Level flowchart builder.
Top Level flowchart builder .
//          simple nodes all treated the same //          processecing class don't ignore definitions etc. //          unlike all other cases //          Note, that normally decl nodes and some others will  //                be skipped by get_next_smt. //          Don't process those : /*          case SMT_expr:
            case SMT_return:
            case SMT_continue:  
*/