Changeset 3 for CMT/v1r19/source/cmt_symbol.cxx
- Timestamp:
- Mar 2, 2005, 5:39:59 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/v1r19/source/cmt_symbol.cxx
r2 r3 1541 1541 case Sh : 1542 1542 cout << "alias " << name << 1543 "=\"" << temp << 1544 "\"; export " << name; 1543 "=\"" << temp << "\""; 1545 1544 result = 1; 1546 1545 break; … … 1590 1589 1591 1590 //------------------------------------------------------------- 1592 cmt_string Symbol::build_macro_value ( ) const1591 cmt_string Symbol::build_macro_value (bool display_it) const 1593 1592 { 1594 1593 cmt_string temp; 1595 1594 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 } 1597 1603 1598 1604 return (temp); … … 1652 1658 ActionType action = Cmt::get_action (); 1653 1659 1654 cmt_string value = build_macro_value ( );1660 cmt_string value = build_macro_value (true); 1655 1661 1656 1662 if ((!Cmt::get_quiet ()) && … … 1754 1760 1755 1761 //------------------------------------------------------------- 1762 ValueBuilder::ValueBuilder () 1763 { 1764 m_display_it = false; 1765 } 1766 1767 //------------------------------------------------------------- 1768 const 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 //------------------------------------------------------------- 1756 1780 const cmt_string SetBuilder::build (const Symbol& symbol, 1757 1781 const cmt_string& /*tag_name*/) … … 1760 1784 static int level = 0; 1761 1785 1762 int show_it = 0;1786 bool show_it = false; 1763 1787 1764 1788 cmt_string temp; … … 1774 1798 { 1775 1799 // Should not display on recursive calls 1776 if (level == 0) show_it = 1;1800 if (level == 0) show_it = m_display_it; 1777 1801 } 1778 1802 } … … 1941 1965 static int level = 0; 1942 1966 1943 int show_it = 0;1967 bool show_it = false; 1944 1968 1945 1969 cmt_string temp; … … 1957 1981 { 1958 1982 // Should not display on recursive calls 1959 if (level == 0) show_it = 1;1983 if (level == 0) show_it = m_display_it; 1960 1984 } 1961 1985 } … … 2276 2300 cmt_string previous_temp; 2277 2301 static const cmt_string empty; 2278 int show_it = 0;2302 bool show_it = false; 2279 2303 2280 2304 ActionType action = Cmt::get_action (); … … 2285 2309 { 2286 2310 // Should not display on recursive calls 2287 if (level == 0) show_it = 1;2311 if (level == 0) show_it = m_display_it; 2288 2312 } 2289 2313 } … … 2522 2546 cmt_string previous_temp; 2523 2547 static const cmt_string empty; 2524 int show_it = 0;2548 bool show_it = false; 2525 2549 2526 2550 ActionType action = Cmt::get_action (); … … 2531 2555 { 2532 2556 // Should not display on recursive calls 2533 if (level == 0) show_it = 1;2557 if (level == 0) show_it = m_display_it; 2534 2558 } 2535 2559 } … … 2789 2813 } 2790 2814 2815 //------------------------------------------------------------- 2816 bool 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.