Ignore:
Timestamp:
Mar 2, 2005, 5:39:59 PM (19 years ago)
Author:
arnault
Message:

Various improvements - Introduction of CMTPROJECTPATH - see CL251

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMT/v1r19/source/cmt_symbol.cxx

    r2 r3  
    15411541            case Sh :
    15421542              cout << "alias " << name <<
    1543                   "=\"" << temp <<
    1544                   "\"; export " << name;
     1543                  "=\"" << temp << "\"";
    15451544              result = 1;
    15461545              break;
     
    15901589
    15911590//-------------------------------------------------------------
    1592 cmt_string Symbol::build_macro_value () const
     1591cmt_string Symbol::build_macro_value (bool display_it) const
    15931592{
    15941593  cmt_string temp;
    15951594
    1596   temp = builder->build (*this);
     1595  if (display_it)
     1596    {
     1597      temp = builder->build_and_display (*this);
     1598    }
     1599  else
     1600    {
     1601      temp = builder->build (*this);
     1602    }
    15971603
    15981604  return (temp);
     
    16521658  ActionType action = Cmt::get_action ();
    16531659
    1654   cmt_string value = build_macro_value ();
     1660  cmt_string value = build_macro_value (true);
    16551661
    16561662  if ((!Cmt::get_quiet ()) &&
     
    17541760
    17551761//-------------------------------------------------------------
     1762ValueBuilder::ValueBuilder ()
     1763{
     1764  m_display_it = false;
     1765}
     1766
     1767//-------------------------------------------------------------
     1768const cmt_string ValueBuilder::build_and_display (const Symbol& symbol)
     1769{
     1770  cmt_string temp;
     1771
     1772  m_display_it = true;
     1773  temp = build (symbol);
     1774  m_display_it = false;
     1775
     1776  return (temp);
     1777}
     1778
     1779//-------------------------------------------------------------
    17561780const cmt_string SetBuilder::build (const Symbol& symbol,
    17571781                                    const cmt_string& /*tag_name*/)
     
    17601784  static int level = 0;
    17611785
    1762   int show_it = 0;
     1786  bool show_it = false;
    17631787
    17641788  cmt_string temp;
     
    17741798        {
    17751799             // Should not display on recursive calls
    1776           if (level == 0) show_it = 1;
     1800          if (level == 0) show_it = m_display_it;
    17771801        }
    17781802    }
     
    19411965  static int level = 0;
    19421966
    1943   int show_it = 0;
     1967  bool show_it = false;
    19441968
    19451969  cmt_string temp;
     
    19571981        {
    19581982            // Should not display on recursive calls
    1959           if (level == 0) show_it = 1;
     1983          if (level == 0) show_it = m_display_it;
    19601984        }
    19611985    }
     
    22762300  cmt_string previous_temp;
    22772301  static const cmt_string empty;
    2278   int show_it = 0;
     2302  bool show_it = false;
    22792303
    22802304  ActionType action = Cmt::get_action ();
     
    22852309        {
    22862310             // Should not display on recursive calls
    2287           if (level == 0) show_it = 1;
     2311          if (level == 0) show_it = m_display_it;
    22882312        }
    22892313    }
     
    25222546  cmt_string previous_temp;
    25232547  static const cmt_string empty;
    2524   int show_it = 0;
     2548  bool show_it = false;
    25252549
    25262550  ActionType action = Cmt::get_action ();
     
    25312555        {
    25322556             // Should not display on recursive calls
    2533           if (level == 0) show_it = 1;
     2557          if (level == 0) show_it = m_display_it;
    25342558        }
    25352559    }
     
    27892813}
    27902814
     2815//-------------------------------------------------------------
     2816bool Symbol::check_tag_used (Tag* tag)
     2817{
     2818  if (tag == 0) return (false);
     2819
     2820  static SymbolVector& Symbols = symbols ();
     2821
     2822  if (Symbols.size () == 0)
     2823    {
     2824      return (false);
     2825    }
     2826
     2827  for (int number = 0; number < Symbol::symbol_number (); number++)
     2828    {
     2829      Symbol& symbol = Symbol::symbol (number);
     2830
     2831      for (int i = 0; i < symbol.value_lists.size (); i++)
     2832        {
     2833          const SymbolValueList& value_list = symbol.value_lists[i];
     2834
     2835          for (int j = 0; j < value_list.values.size (); j++)
     2836            {
     2837              const SymbolValue& value = value_list.values[j];
     2838              Tag* t = value.tag;
     2839
     2840              if (t != 0)
     2841                {
     2842                  if (t->use_operand (tag)) return (true);
     2843                }
     2844            }
     2845        }
     2846    }
     2847
     2848  return (false);
     2849}
     2850
Note: See TracChangeset for help on using the changeset viewer.