Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

ActionBuilder Class Reference

Inheritance diagram for ActionBuilder:

Inheritance graph
[legend]
Collaboration diagram for ActionBuilder:

Collaboration graph
[legend]
List of all members.

Public Member Functions

const cmt_string build (const Symbol &symbol, const cmt_string &tag_name="")
const cmt_string clean (const Symbol &symbol, const cmt_string &tag_name="")

Member Function Documentation

const cmt_string ActionBuilder::build const Symbol symbol,
const cmt_string tag_name = ""
[virtual]
 

Implements ValueBuilder.

Definition at line 2562 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< T >::size(), SymbolValue::text, SymbolValueList::use, Symbol::value_is_reflexive(), Symbol::value_lists, and SymbolValueList::values.

02564 {
02565     // Control of recursivity
02566   static int level = 0;
02567 
02568   cmt_string temp;
02569   cmt_string previous_temp;
02570   static const cmt_string empty;
02571   bool show_it = false;
02572 
02573   ActionType action = Cmt::get_action ();
02574 
02575   if (action == action_show_action)
02576     {
02577       if (symbol.name == Cmt::get_current_target ())
02578         {
02579              // Should not display on recursive calls
02580           if (level == 0) show_it = m_display_it;
02581         }
02582     }
02583 
02584   level++;
02585 
02586   int i;
02587 
02588   bool first_definition = true;
02589   bool defined = false;
02590 
02591   temp = "";
02592 
02593   for (i = 0; i < symbol.value_lists.size (); i++)
02594     {
02595       const SymbolValueList& value_list = symbol.value_lists[i];
02596 
02597       if ((value_list.use != 0) &&
02598           (value_list.use->discarded)) continue;
02599 
02600       if (value_list.command_type != CommandAction) continue;
02601 
02602       const int selected = value_list.select_first (tag_name);
02603 
02604       if (selected < 0) continue;
02605 
02606       SymbolValue& value = value_list.values[selected];
02607 
02608       if (show_it)
02609         {
02610           value_list.show (symbol, value, first_definition);
02611         }
02612 
02613       // WARNING:
02614       // Commented just for a test : should be uncommented after the test
02615       if (value_list.discarded) continue;
02616       
02617       if (!value_list.is_reflexive || 
02618           !symbol.value_is_reflexive (value.text))
02619         {
02620           temp = value.text;
02621 
02622           if (!defined)
02623             {
02624               defined = true;
02625             }
02626           else
02627             {
02628               if ((!Cmt::get_quiet ()) &&
02629                   ((action == action_show_macro) ||
02630                    (action == action_show_set) ||
02631                    (action == action_show_action) ||
02632                    (action == action_show_macros) ||
02633                    (action == action_show_sets) ||
02634                    (action == action_show_actions)))
02635                 {
02636                   cerr << "#CMT> Warning: Symbol " << symbol.name << " overridden";
02637                   
02638                   if (value_list.use != 0)
02639                     {
02640                       cerr << " in package " << value_list.use->get_package_name ();
02641                     }
02642 
02643                   cerr << endl;
02644                 }
02645             }
02646         }
02647     }
02648 
02649   level--;
02650 
02651   return (temp);
02652 }

const cmt_string ActionBuilder::clean const Symbol symbol,
const cmt_string tag_name = ""
[inline, virtual]
 

Implements ValueBuilder.

Definition at line 79 of file cmt_symbol.cxx.

00081       {
00082         static const cmt_string empty = "";
00083         return (empty);
00084       }


The documentation for this class was generated from the following file:
Generated on Mon May 2 10:25:25 2005 for CMT by doxygen 1.3.5