Changes in / [3:1]


Ignore:
Location:
/CMT/v1r19
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • /CMT/v1r19/ChangeLog

    r3 r1  
    1 2005-03-02  Christian Arnault  <arnault@lal.in2p3.fr> 251
    2 
    3         * source/cmt_symbol.h (class Symbol): Add an optional argument to build_macro_value to switch display mode
    4 
    5         * source/cmt_symbol.cxx (show_macro): Improve the display mode so as to display only once the macro construction steps
    6 
    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 arguments
    10 
    11         * source/cmt_error.cxx (class Error): Added unknown_command error
    12         * source/cmt_error.h (class CmtError): Added unknown_command error
    13 
    14         * source/cmt_commands.cxx (do_filter): Missing implementation for the filter command
    15 
    16 2005-03-01  Christian Arnault  <arnault@lal.in2p3.fr> 251
    17 
    18         * source/cmt_tag.cxx (use_operand): Add way of checking internal structure of a tag
    19         * source/cmt_tag.cxx (use_ref): Add way of checking internal structure of a tag
    20 
    21         * source/cmt_tag.h (class Tag): Add way of checking internal structure of a tag
    22 
    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 mode
    26 
    27         * source/cmt_project.cxx: Introduce use_action
    28 
    29         * source/cmt_syntax.cxx (SyntaxParser): Add support to use statements in project files
    30 
    31         * source/cmt_project.cxx (create_project): Add comments
    32 
    3312004-12-14    <arnault@lal.in2p3.fr> 250
    342
  • /CMT/v1r19/mgr/INSTALL

    r3 r1  
    1111#--------------------------------------------------
    1212
    13 #set -x
     13##set -v
    1414
    1515here=`pwd`                #should be .../CMT/vxxx/mgr
  • /CMT/v1r19/source/cmt_commands.cxx

    r3 r1  
    422422  shift ();
    423423
    424   cmt.m_action = action_none;
    425 
    426424  while (argc > 0)
    427425    {
     
    459457      if (parsers.has (reduced_arg))
    460458        {
    461           // This argument corresponds to a known command
    462 
    463459          int i = (*parsers.find (reduced_arg));
    464460
     
    466462          (me.*p) ();
    467463        }
    468       else if (cmt.m_action != action_none)
    469         {
    470           // We have unexpected arguments (not handled by the command handler). This may sign
    471           // an unprotected handler implementation.
    472           if (!cmt.m_quiet) cerr << "#CMT> warning : unexpected parameter " << reduced_arg << endl;
    473         }
    474464      else
    475465        {
    476           // This argument does not correspond to a known command. We expect then an action
    477           // to be executed with that name
    478 
    479466          unshift ();
    480467          do_do ();
     
    926913void ArgParser::do_filter ()
    927914{
    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;
    939916}
    940917
     
    17131690      Tag* tag;
    17141691      CmtSystem::cmt_string_vector words;
    1715 
     1692                 
    17161693      // First reset selection of all existing tags
    17171694      //Tag::clear_all ();
  • /CMT/v1r19/source/cmt_error.cxx

    r3 r1  
    3333    error_names.add() = "cannot_remove_lock";
    3434    error_names.add() = "conflicting_lock";
    35     error_names.add() = "unknown_command";
    3635  }
    3736
  • /CMT/v1r19/source/cmt_error.h

    r3 r1  
    3434    cannot_run_unlock_command,
    3535    cannot_remove_lock,
    36     conflicting_lock,
    37     unknown_command
     36    conflicting_lock
    3837  } code;
    3938
  • /CMT/v1r19/source/cmt_parser.cxx

    r3 r1  
    19611961void Cmt::do_check_configuration (const ArgParser& ap)
    19621962{
    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     }
    20161963}
    20171964
     
    25072454        {
    25082455          Me.m_action = action_show_action_names;
    2509           /*
    25102456          if (!Me.m_quiet)
    25112457            {
     
    25132459              print_symbol_names (ap.mode);
    25142460            }
    2515           */
    2516           CmtError::set (CmtError::unknown_command, ap.arguments[0]);
     2461          CmtError::set (CmtError::symbol_not_found, ap.arguments[0]);
    25172462          return;
    25182463        }
     
    30412986void Cmt::do_setup (const ArgParser& ap)
    30422987{
    3043 
    3044   do_check_configuration (ap);
    3045 
    30462988  print (ap.mode);
    30472989
     
    39243866            {
    39253867              //this directory should become the first entry of the CMTPATH
    3926 
    3927               IProjectFactory& factory = ProjectFactory::instance ();
    3928               factory.create_project (pwd, "CurrentProject");
    3929 
    3930               /*
    39313868              cmt_string temp = "path_prepend CMTPATH \"";
    39323869              temp += pwd;
     
    39363873
    39373874              SyntaxParser::parse_requirements_line (temp, &use);
    3938               */
    3939 
     3875             
    39403876              break;
    39413877            }
     
    39543890      CmtSystem::cd (Me.m_current_dir);
    39553891    }
    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);
    39623892}
    39633893
  • /CMT/v1r19/source/cmt_project.cxx

    r3 r1  
    9797}
    9898
    99 /*
    100   Every new CMTPATH entry becomes associated with a dedicated PROJECT
    101   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 project
    104      - then it tries to read and parse its project file
    105  */
    10699void ProjectFactory::create_project (const cmt_string& path,
    107100                                     const cmt_string& source)
     
    128121  if (!CmtSystem::cd (compressed_path)) return;
    129122
    130   //
    131   // Figure out if this is the current project
    132   //
    133123  cmt_string pwd = CmtSystem::pwd ();
    134124  if (here.find (pwd) == 0) is_current = true;
     
    136126  cmt_string text;
    137127
    138   /*
    139     Now Figure out the project name from the project file
    140     Or construct an automatic project name when project file does no exist
    141     or does not specify the project name
    142    */
    143128  if (CmtSystem::cd ("cmt") && CmtSystem::test_file (Project::get_project_file_name ()))
    144129    {
     
    195180  if (is_current)
    196181    {
    197       //
    198       // The current project defines a tag with its name
    199       //
    200 
    201182      Tag* tag;
    202183     
     
    210191  if (text != "")
    211192    {
    212       // Last step is to parse the project file
    213 
    214193      SyntaxParser::parse_project_file_text (text,
    215194                                             Project::get_project_file_name (),
     
    568547
    569548  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-set
    578     which is the case when CMTPROJECTPATH is only used
    579    */
    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     }
    600549}
    601550
     
    799748    }
    800749}
    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 specified
    808   //
    809   // Is this project already visible?
    810   // If not: look for it
    811   //   + get CMTPROJECTPATH
    812   //   + search from all entries of CMTPROJECTPATH : pi/<name>/<release>
    813   //   + when found, this should become a new CMTPATH entry
    814   //   +             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 
    847750
    848751//----------------------------------------------------------
  • /CMT/v1r19/source/cmt_project.h

    r3 r1  
    6464  static cmt_string find_in_cmt_paths (const cmt_string& path);
    6565
    66   static void set_cmtpaths (cmt_string& buffer);
    67 
    6866public:
    6967
     
    8280  void clear ();
    8381  void configure ();
    84 
    85   void use_action (const cmt_string& name, const cmt_string& release);
    8682
    8783  Project& operator = (const Project& other);
  • /CMT/v1r19/source/cmt_symbol.cxx

    r3 r1  
    15411541            case Sh :
    15421542              cout << "alias " << name <<
    1543                   "=\"" << temp << "\"";
     1543                  "=\"" << temp <<
     1544                  "\"; export " << name;
    15441545              result = 1;
    15451546              break;
     
    15891590
    15901591//-------------------------------------------------------------
    1591 cmt_string Symbol::build_macro_value (bool display_it) const
     1592cmt_string Symbol::build_macro_value () const
    15921593{
    15931594  cmt_string temp;
    15941595
    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);
    16031597
    16041598  return (temp);
     
    16581652  ActionType action = Cmt::get_action ();
    16591653
    1660   cmt_string value = build_macro_value (true);
     1654  cmt_string value = build_macro_value ();
    16611655
    16621656  if ((!Cmt::get_quiet ()) &&
     
    17601754
    17611755//-------------------------------------------------------------
    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 //-------------------------------------------------------------
    17801756const cmt_string SetBuilder::build (const Symbol& symbol,
    17811757                                    const cmt_string& /*tag_name*/)
     
    17841760  static int level = 0;
    17851761
    1786   bool show_it = false;
     1762  int show_it = 0;
    17871763
    17881764  cmt_string temp;
     
    17981774        {
    17991775             // Should not display on recursive calls
    1800           if (level == 0) show_it = m_display_it;
     1776          if (level == 0) show_it = 1;
    18011777        }
    18021778    }
     
    19651941  static int level = 0;
    19661942
    1967   bool show_it = false;
     1943  int show_it = 0;
    19681944
    19691945  cmt_string temp;
     
    19811957        {
    19821958            // Should not display on recursive calls
    1983           if (level == 0) show_it = m_display_it;
     1959          if (level == 0) show_it = 1;
    19841960        }
    19851961    }
     
    23002276  cmt_string previous_temp;
    23012277  static const cmt_string empty;
    2302   bool show_it = false;
     2278  int show_it = 0;
    23032279
    23042280  ActionType action = Cmt::get_action ();
     
    23092285        {
    23102286             // Should not display on recursive calls
    2311           if (level == 0) show_it = m_display_it;
     2287          if (level == 0) show_it = 1;
    23122288        }
    23132289    }
     
    25462522  cmt_string previous_temp;
    25472523  static const cmt_string empty;
    2548   bool show_it = false;
     2524  int show_it = 0;
    25492525
    25502526  ActionType action = Cmt::get_action ();
     
    25552531        {
    25562532             // Should not display on recursive calls
    2557           if (level == 0) show_it = m_display_it;
     2533          if (level == 0) show_it = 1;
    25582534        }
    25592535    }
     
    28132789}
    28142790
    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  
    4747{
    4848public:
    49   ValueBuilder ();
    50   const cmt_string build_and_display (const Symbol& symbol);
    51 
    5249  virtual const cmt_string build (const Symbol& symbol,
    5350                                  const cmt_string& tag_name = "") = 0;
    5451  virtual const cmt_string clean (const Symbol& symbol,
    5552                                  const cmt_string& tag_name = "") = 0;
    56  protected:
    57   bool m_display_it;
    5853};
    5954
     
    9792  static void expand (cmt_string& text);
    9893
    99   static bool check_tag_used (Tag* tag);
    100 
    10194public:
    10295  Symbol ();
     
    110103  int print_clean (PrintMode mode);
    111104  int print (PrintMode mode);
    112   cmt_string build_macro_value (bool display_it = false) const;
     105  cmt_string build_macro_value () const;
    113106  cmt_string clean_macro_value () const;
    114107  cmt_string resolve_macro_value (const cmt_string& tag_name = "");
  • /CMT/v1r19/source/cmt_syntax.cxx

    r3 r1  
    898898  {
    899899    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]);
    908900  }
    909901};
     
    11271119  m_project_keywords.add ("project", new KwdProject ());
    11281120  m_project_keywords.add ("setup_strategy", new KwdSetupStrategy ());
    1129   m_project_keywords.add ("use", new KwdUse ());
    11301121}
    11311122
  • /CMT/v1r19/source/cmt_tag.cxx

    r3 r1  
    572572
    573573  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);
    585574}
    586575
     
    863852}
    864853
    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  
    3939  static Tag* get_default ();
    4040
    41   static bool check_tag_used (const Tag* tag);
    42 
    4341public:
    4442  Tag ();
     
    5856  int get_priority () const;
    5957  void install (TagMap& instances);
    60   bool use_operand (const Tag* other) const;
    61   bool use_ref (const Tag* other) const;
    6258
    6359private:
  • /CMT/v1r19/source/cmt_version.h

    r3 r1  
    88#define __cmt_version_h__
    99
    10 #define CMTVERSION "v1r18p2005"
     10#define CMTVERSION "v1r18p20041201"
    1111
    1212#endif
Note: See TracChangeset for help on using the changeset viewer.