? |
Implements ValueBuilder.
Definition at line 2515 of file cmt_symbol.cxx.
References action_show_action, action_show_actions, action_show_macro, action_show_macros, action_show_set, action_show_sets, ActionType, SymbolValueList::command_type, CommandAction, SymbolValueList::discarded, Use::discarded, Cmt::get_action(), Cmt::get_current_target(), Use::get_package_name(), Cmt::get_quiet(), SymbolValueList::is_reflexive, Symbol::name, SymbolValueList::select_first(), SymbolValueList::show(), cmt_vector< SymbolValueList >::size(), SymbolValue::text, SymbolValueList::use, Symbol::value_is_reflexive(), Symbol::value_lists, and SymbolValueList::values.
02517 {
02518
02519 static int level = 0;
02520
02521 cmt_string temp;
02522 cmt_string previous_temp;
02523 static const cmt_string empty;
02524 int show_it = 0;
02525
02526 ActionType action = Cmt::get_action ();
02527
02528 if (action == action_show_action)
02529 {
02530 if (symbol.name == Cmt::get_current_target ())
02531 {
02532
02533 if (level == 0) show_it = 1;
02534 }
02535 }
02536
02537 level++;
02538
02539 int i;
02540
02541 bool first_definition = true;
02542 bool defined = false;
02543
02544 temp = "";
02545
02546 for (i = 0; i < symbol.value_lists.size (); i++)
02547 {
02548 const SymbolValueList& value_list = symbol.value_lists[i];
02549
02550 if ((value_list.use != 0) &&
02551 (value_list.use->discarded)) continue;
02552
02553 if (value_list.command_type != CommandAction) continue;
02554
02555 const int selected = value_list.select_first (tag_name);
02556
02557 if (selected < 0) continue;
02558
02559 SymbolValue& value = value_list.values[selected];
02560
02561 if (show_it)
02562 {
02563 value_list.show (symbol, value, first_definition);
02564 }
02565
02566
02567
02568 if (value_list.discarded) continue;
02569
02570 if (!value_list.is_reflexive ||
02571 !symbol.value_is_reflexive (value.text))
02572 {
02573 temp = value.text;
02574
02575 if (!defined)
02576 {
02577 defined = true;
02578 }
02579 else
02580 {
02581 if ((!Cmt::get_quiet ()) &&
02582 ((action == action_show_macro) ||
02583 (action == action_show_set) ||
02584 (action == action_show_action) ||
02585 (action == action_show_macros) ||
02586 (action == action_show_sets) ||
02587 (action == action_show_actions)))
02588 {
02589 cerr << "#CMT> Warning: Symbol " << symbol.name << " overridden";
02590
02591 if (value_list.use != 0)
02592 {
02593 cerr << " in package " << value_list.use->get_package_name ();
02594 }
02595
02596 cerr << endl;
02597 }
02598 }
02599 }
02600 }
02601
02602 level--;
02603
02604 return (temp);
02605 }
|