- Location:
- /CMT/v1r19
- Files:
-
- 15 edited
-
ChangeLog (modified) (1 diff)
-
doc/installations.doc (modified) ( previous)
-
mgr/INSTALL (modified) (1 diff)
-
source/cmt_commands.cxx (modified) (5 diffs)
-
source/cmt_error.cxx (modified) (1 diff)
-
source/cmt_error.h (modified) (1 diff)
-
source/cmt_parser.cxx (modified) (7 diffs)
-
source/cmt_project.cxx (modified) (7 diffs)
-
source/cmt_project.h (modified) (2 diffs)
-
source/cmt_symbol.cxx (modified) (13 diffs)
-
source/cmt_symbol.h (modified) (3 diffs)
-
source/cmt_syntax.cxx (modified) (2 diffs)
-
source/cmt_tag.cxx (modified) (2 diffs)
-
source/cmt_tag.h (modified) (2 diffs)
-
source/cmt_version.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
/CMT/v1r19/ChangeLog
r3 r1 1 2005-03-02 Christian Arnault <arnault@lal.in2p3.fr> 2512 3 * source/cmt_symbol.h (class Symbol): Add an optional argument to build_macro_value to switch display mode4 5 * source/cmt_symbol.cxx (show_macro): Improve the display mode so as to display only once the macro construction steps6 7 * source/cmt_parser.cxx (guess_current_project): Regenerate CMTPATH from the effective set of subprojects.8 9 * source/cmt_commands.cxx (parse): Handle unexpected arguments10 11 * source/cmt_error.cxx (class Error): Added unknown_command error12 * source/cmt_error.h (class CmtError): Added unknown_command error13 14 * source/cmt_commands.cxx (do_filter): Missing implementation for the filter command15 16 2005-03-01 Christian Arnault <arnault@lal.in2p3.fr> 25117 18 * source/cmt_tag.cxx (use_operand): Add way of checking internal structure of a tag19 * source/cmt_tag.cxx (use_ref): Add way of checking internal structure of a tag20 21 * source/cmt_tag.h (class Tag): Add way of checking internal structure of a tag22 23 * source/cmt_symbol.h (class Symbol): Add way of checking if a tag is used by symbols.24 25 * source/cmt_symbol.cxx (print): Suppress the "export" action after defining an alias in Sh mode26 27 * source/cmt_project.cxx: Introduce use_action28 29 * source/cmt_syntax.cxx (SyntaxParser): Add support to use statements in project files30 31 * source/cmt_project.cxx (create_project): Add comments32 33 1 2004-12-14 <arnault@lal.in2p3.fr> 250 34 2 -
/CMT/v1r19/mgr/INSTALL
r3 r1 11 11 #-------------------------------------------------- 12 12 13 # set -x13 ##set -v 14 14 15 15 here=`pwd` #should be .../CMT/vxxx/mgr -
/CMT/v1r19/source/cmt_commands.cxx
r3 r1 422 422 shift (); 423 423 424 cmt.m_action = action_none;425 426 424 while (argc > 0) 427 425 { … … 459 457 if (parsers.has (reduced_arg)) 460 458 { 461 // This argument corresponds to a known command462 463 459 int i = (*parsers.find (reduced_arg)); 464 460 … … 466 462 (me.*p) (); 467 463 } 468 else if (cmt.m_action != action_none)469 {470 // We have unexpected arguments (not handled by the command handler). This may sign471 // an unprotected handler implementation.472 if (!cmt.m_quiet) cerr << "#CMT> warning : unexpected parameter " << reduced_arg << endl;473 }474 464 else 475 465 { 476 // This argument does not correspond to a known command. We expect then an action477 // to be executed with that name478 479 466 unshift (); 480 467 do_do (); … … 926 913 void ArgParser::do_filter () 927 914 { 928 if (argc > 0) 929 { 930 fill_arguments (); 931 cmt.m_action = action_filter; 932 } 933 else 934 { 935 if (!cmt.m_quiet) cerr << "#CMT> syntax error : file to filter not specified" << endl; 936 help_action = action_help; 937 cmt.m_action = action_filter; 938 } 915 cmt.m_action = action_filter; 939 916 } 940 917 … … 1713 1690 Tag* tag; 1714 1691 CmtSystem::cmt_string_vector words; 1715 1692 1716 1693 // First reset selection of all existing tags 1717 1694 //Tag::clear_all (); -
/CMT/v1r19/source/cmt_error.cxx
r3 r1 33 33 error_names.add() = "cannot_remove_lock"; 34 34 error_names.add() = "conflicting_lock"; 35 error_names.add() = "unknown_command";36 35 } 37 36 -
/CMT/v1r19/source/cmt_error.h
r3 r1 34 34 cannot_run_unlock_command, 35 35 cannot_remove_lock, 36 conflicting_lock, 37 unknown_command 36 conflicting_lock 38 37 } code; 39 38 -
/CMT/v1r19/source/cmt_parser.cxx
r3 r1 1961 1961 void Cmt::do_check_configuration (const ArgParser& ap) 1962 1962 { 1963 cmt_string env;1964 Tag* tag;1965 1966 static CmtSystem::cmt_string_vector tags;1967 1968 CmtSystem::split (Me.m_extra_tags, " \t,", tags);1969 1970 for (int i = 0; i < tags.size (); i++)1971 {1972 const cmt_string& t = tags[i];1973 1974 tag = Tag::find (t);1975 if (tag == 0) continue;1976 1977 if (!Tag::check_tag_used (tag) && !Symbol::check_tag_used (tag))1978 {1979 cerr << "#CMT> The tag " << t << " is not used in any tag expression. Please check spelling" << endl;1980 }1981 }1982 1983 env = CmtSystem::getenv ("CMTSITE");1984 if (env == "")1985 {1986 return;1987 }1988 1989 tag = Tag::find (env);1990 if (tag == 0)1991 {1992 return;1993 }1994 1995 if (!Tag::check_tag_used (tag) && !Symbol::check_tag_used (tag))1996 {1997 cerr << "#CMT> The CMTSITE value " << env << " is not used in any tag expression. Please check spelling" << endl;1998 }1999 2000 env = CmtSystem::getenv ("CMTCONFIG");2001 if (env == "")2002 {2003 return;2004 }2005 2006 tag = Tag::find (env);2007 if (tag == 0)2008 {2009 return;2010 }2011 2012 if (!Tag::check_tag_used (tag) && !Symbol::check_tag_used (tag))2013 {2014 cerr << "#CMT> The CMTCONFIG value " << env << " is not used in any tag expression. Please check spelling" << endl;2015 }2016 1963 } 2017 1964 … … 2507 2454 { 2508 2455 Me.m_action = action_show_action_names; 2509 /*2510 2456 if (!Me.m_quiet) 2511 2457 { … … 2513 2459 print_symbol_names (ap.mode); 2514 2460 } 2515 */ 2516 CmtError::set (CmtError::unknown_command, ap.arguments[0]); 2461 CmtError::set (CmtError::symbol_not_found, ap.arguments[0]); 2517 2462 return; 2518 2463 } … … 3041 2986 void Cmt::do_setup (const ArgParser& ap) 3042 2987 { 3043 3044 do_check_configuration (ap);3045 3046 2988 print (ap.mode); 3047 2989 … … 3924 3866 { 3925 3867 //this directory should become the first entry of the CMTPATH 3926 3927 IProjectFactory& factory = ProjectFactory::instance ();3928 factory.create_project (pwd, "CurrentProject");3929 3930 /*3931 3868 cmt_string temp = "path_prepend CMTPATH \""; 3932 3869 temp += pwd; … … 3936 3873 3937 3874 SyntaxParser::parse_requirements_line (temp, &use); 3938 */ 3939 3875 3940 3876 break; 3941 3877 } … … 3954 3890 CmtSystem::cd (Me.m_current_dir); 3955 3891 } 3956 3957 cmt_string buffer = "path CMTPATH \n";3958 Project::set_cmtpaths (buffer);3959 //cerr << "buffer = " << buffer << endl;3960 Use& use = Use::current();3961 SyntaxParser::parse_requirements_text (buffer, "", &use);3962 3892 } 3963 3893 -
/CMT/v1r19/source/cmt_project.cxx
r3 r1 97 97 } 98 98 99 /*100 Every new CMTPATH entry becomes associated with a dedicated PROJECT101 This function will understand this new entry to CMTPATH and understand it:102 - it can correspond to an existing project (ie already declared)103 - it's a new project104 - then it tries to read and parse its project file105 */106 99 void ProjectFactory::create_project (const cmt_string& path, 107 100 const cmt_string& source) … … 128 121 if (!CmtSystem::cd (compressed_path)) return; 129 122 130 //131 // Figure out if this is the current project132 //133 123 cmt_string pwd = CmtSystem::pwd (); 134 124 if (here.find (pwd) == 0) is_current = true; … … 136 126 cmt_string text; 137 127 138 /*139 Now Figure out the project name from the project file140 Or construct an automatic project name when project file does no exist141 or does not specify the project name142 */143 128 if (CmtSystem::cd ("cmt") && CmtSystem::test_file (Project::get_project_file_name ())) 144 129 { … … 195 180 if (is_current) 196 181 { 197 //198 // The current project defines a tag with its name199 //200 201 182 Tag* tag; 202 183 … … 210 191 if (text != "") 211 192 { 212 // Last step is to parse the project file213 214 193 SyntaxParser::parse_project_file_text (text, 215 194 Project::get_project_file_name (), … … 568 547 569 548 return (""); 570 }571 572 //----------------------------------------------------------573 void Project::set_cmtpaths (cmt_string& buffer)574 {575 /*576 Try to re-create all CMTPATH items from project definitions.577 The goal is to generate CMTPATH even if this EV was not pre-set578 which is the case when CMTPROJECTPATH is only used579 */580 581 static ProjectVector& Projects = projects ();582 583 for (int i = 0; i < Projects.size (); i++)584 {585 const Project& project = Projects[i];586 587 const cmt_string& p = project.m_cmtpath;588 const cmt_string& w = project.m_cmtpath_pwd;589 const cmt_string& s = project.m_cmtpath_source;590 591 if (s == "default path") continue;592 593 if (CmtSystem::test_directory (w))594 {595 buffer += "path_append CMTPATH \"";596 buffer += w;597 buffer += "\" \n";598 }599 }600 549 } 601 550 … … 799 748 } 800 749 } 801 802 //----------------------------------------------------------803 void Project::use_action (const cmt_string& name, const cmt_string& release)804 {805 //cerr << "Use action " << name << " " << release << endl;806 807 // A project with its release is specified808 //809 // Is this project already visible?810 // If not: look for it811 // + get CMTPROJECTPATH812 // + search from all entries of CMTPROJECTPATH : pi/<name>/<release>813 // + when found, this should become a new CMTPATH entry814 // + the new project is then parsed ... etc...815 816 // Question : do we consider by default pwd/../.. ???817 818 cmt_string cmtprojectpath = CmtSystem::getenv ("CMTPROJECTPATH");819 cmt_string sep;820 sep += CmtSystem::path_separator ();821 822 //cerr << "cmtprojectpath = " << cmtprojectpath << endl;823 CmtSystem::cmt_string_vector items;824 CmtSystem::split (cmtprojectpath, sep, items);825 for (int i = 0; i < items.size (); i++)826 {827 const cmt_string& item = items[i];828 cmt_string p = item;829 p += CmtSystem::file_separator ();830 p += name;831 p += CmtSystem::file_separator ();832 p += release;833 834 if (CmtSystem::test_directory (p))835 {836 //cerr << "Project directry " << p << " exists " << endl;837 838 IProjectFactory& factory = ProjectFactory::instance ();839 840 factory.create_project (p, "ProjectPath");841 842 break;843 }844 }845 }846 847 750 848 751 //---------------------------------------------------------- -
/CMT/v1r19/source/cmt_project.h
r3 r1 64 64 static cmt_string find_in_cmt_paths (const cmt_string& path); 65 65 66 static void set_cmtpaths (cmt_string& buffer);67 68 66 public: 69 67 … … 82 80 void clear (); 83 81 void configure (); 84 85 void use_action (const cmt_string& name, const cmt_string& release);86 82 87 83 Project& operator = (const Project& other); -
/CMT/v1r19/source/cmt_symbol.cxx
r3 r1 1541 1541 case Sh : 1542 1542 cout << "alias " << name << 1543 "=\"" << temp << "\""; 1543 "=\"" << temp << 1544 "\"; export " << name; 1544 1545 result = 1; 1545 1546 break; … … 1589 1590 1590 1591 //------------------------------------------------------------- 1591 cmt_string Symbol::build_macro_value ( bool display_it) const1592 cmt_string Symbol::build_macro_value () const 1592 1593 { 1593 1594 cmt_string temp; 1594 1595 1595 if (display_it) 1596 { 1597 temp = builder->build_and_display (*this); 1598 } 1599 else 1600 { 1601 temp = builder->build (*this); 1602 } 1596 temp = builder->build (*this); 1603 1597 1604 1598 return (temp); … … 1658 1652 ActionType action = Cmt::get_action (); 1659 1653 1660 cmt_string value = build_macro_value ( true);1654 cmt_string value = build_macro_value (); 1661 1655 1662 1656 if ((!Cmt::get_quiet ()) && … … 1760 1754 1761 1755 //------------------------------------------------------------- 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 //-------------------------------------------------------------1780 1756 const cmt_string SetBuilder::build (const Symbol& symbol, 1781 1757 const cmt_string& /*tag_name*/) … … 1784 1760 static int level = 0; 1785 1761 1786 bool show_it = false;1762 int show_it = 0; 1787 1763 1788 1764 cmt_string temp; … … 1798 1774 { 1799 1775 // Should not display on recursive calls 1800 if (level == 0) show_it = m_display_it;1776 if (level == 0) show_it = 1; 1801 1777 } 1802 1778 } … … 1965 1941 static int level = 0; 1966 1942 1967 bool show_it = false;1943 int show_it = 0; 1968 1944 1969 1945 cmt_string temp; … … 1981 1957 { 1982 1958 // Should not display on recursive calls 1983 if (level == 0) show_it = m_display_it;1959 if (level == 0) show_it = 1; 1984 1960 } 1985 1961 } … … 2300 2276 cmt_string previous_temp; 2301 2277 static const cmt_string empty; 2302 bool show_it = false;2278 int show_it = 0; 2303 2279 2304 2280 ActionType action = Cmt::get_action (); … … 2309 2285 { 2310 2286 // Should not display on recursive calls 2311 if (level == 0) show_it = m_display_it;2287 if (level == 0) show_it = 1; 2312 2288 } 2313 2289 } … … 2546 2522 cmt_string previous_temp; 2547 2523 static const cmt_string empty; 2548 bool show_it = false;2524 int show_it = 0; 2549 2525 2550 2526 ActionType action = Cmt::get_action (); … … 2555 2531 { 2556 2532 // Should not display on recursive calls 2557 if (level == 0) show_it = m_display_it;2533 if (level == 0) show_it = 1; 2558 2534 } 2559 2535 } … … 2813 2789 } 2814 2790 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 -
/CMT/v1r19/source/cmt_symbol.h
r3 r1 47 47 { 48 48 public: 49 ValueBuilder ();50 const cmt_string build_and_display (const Symbol& symbol);51 52 49 virtual const cmt_string build (const Symbol& symbol, 53 50 const cmt_string& tag_name = "") = 0; 54 51 virtual const cmt_string clean (const Symbol& symbol, 55 52 const cmt_string& tag_name = "") = 0; 56 protected:57 bool m_display_it;58 53 }; 59 54 … … 97 92 static void expand (cmt_string& text); 98 93 99 static bool check_tag_used (Tag* tag);100 101 94 public: 102 95 Symbol (); … … 110 103 int print_clean (PrintMode mode); 111 104 int print (PrintMode mode); 112 cmt_string build_macro_value ( bool display_it = false) const;105 cmt_string build_macro_value () const; 113 106 cmt_string clean_macro_value () const; 114 107 cmt_string resolve_macro_value (const cmt_string& tag_name = ""); -
/CMT/v1r19/source/cmt_syntax.cxx
r3 r1 898 898 { 899 899 Use::action (words, use); 900 }901 902 void action (const CmtSystem::cmt_string_vector& words,903 Project* project,904 const cmt_string& file_name,905 int line_number)906 {907 project->use_action (words[1], words[2]);908 900 } 909 901 }; … … 1127 1119 m_project_keywords.add ("project", new KwdProject ()); 1128 1120 m_project_keywords.add ("setup_strategy", new KwdSetupStrategy ()); 1129 m_project_keywords.add ("use", new KwdUse ());1130 1121 } 1131 1122 -
/CMT/v1r19/source/cmt_tag.cxx
r3 r1 572 572 573 573 return (&(default_tag)); 574 }575 576 /*----------------------------------------------------------*/577 bool Tag::check_tag_used (const Tag* tag)578 {579 if (tag == 0) return (false);580 581 if (tag->m_tag_refs.size () > 0) return (true);582 if (tag->m_tag_excludes.size () > 0) return (true);583 584 return (false);585 574 } 586 575 … … 863 852 } 864 853 865 /* 866 Check if a tag is part of the operands of a tag 867 */ 868 bool Tag::use_operand (const Tag* other) const 869 { 870 if (other == this) return (true); 871 if (m_and_operands.size () == 0) return (false); 872 873 for (int i = 0; i < m_and_operands.size (); i++) 874 { 875 Tag* t = m_and_operands[i]; 876 877 if (t != 0) 878 { 879 if (t->use_operand (other)) return (true); 880 } 881 } 882 883 return (false); 884 } 885 886 /* 887 Check if a tag is part of the refs of a tag 888 */ 889 bool Tag::use_ref (const Tag* other) const 890 { 891 if (other == this) return (false); 892 if (m_tag_refs.size () == 0) return (false); 893 894 for (int i = 0; i < m_tag_refs.size (); i++) 895 { 896 Tag* t = m_tag_refs[i]; 897 898 if (t == other) return (true); 899 } 900 901 return (false); 902 } 903 904 854 -
/CMT/v1r19/source/cmt_tag.h
r3 r1 39 39 static Tag* get_default (); 40 40 41 static bool check_tag_used (const Tag* tag);42 43 41 public: 44 42 Tag (); … … 58 56 int get_priority () const; 59 57 void install (TagMap& instances); 60 bool use_operand (const Tag* other) const;61 bool use_ref (const Tag* other) const;62 58 63 59 private: -
/CMT/v1r19/source/cmt_version.h
r3 r1 8 8 #define __cmt_version_h__ 9 9 10 #define CMTVERSION "v1r18p200 5"10 #define CMTVERSION "v1r18p20041201" 11 11 12 12 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
