source: CMT/v1r14p20031120/src/cmt_syntax.cxx @ 1

Last change on this file since 1 was 1, checked in by arnault, 19 years ago

Import all tags

File size: 48.2 KB
Line 
1
2
3#include "cmt_syntax.h"
4#include "cmt.h"
5#include "cmt_symbol.h"
6#include "cmt_constituent.h"
7#include "cmt_pattern.h"
8#include "cmt_error.h"
9#include "cmt_branch.h"
10#include "cmt_error.h"
11#include "cmt_script.h"
12#include "cmt_language.h"
13#include "cmt_project.h"
14#include "cmt_cmtpath_pattern.h"
15
16class KwdAlias : public Kwd
17{
18public:
19  void action (const CmtSystem::cmt_string_vector& words,
20               Use* use,
21               const cmt_string& file_name,
22               int line_number)
23  {
24    Symbol::action (words, CommandAlias, use);
25  }
26};
27
28class KwdApplication : public Kwd
29{
30public:
31  void action (const CmtSystem::cmt_string_vector& words,
32               Use* use,
33               const cmt_string& file_name,
34               int line_number)
35  {
36    if (use == &(Use::current ()))
37      {
38        Constituent::action (Application, words);
39      }
40  }
41};
42
43class KwdApplyPattern : public Kwd
44{
45public:
46  void action (const CmtSystem::cmt_string_vector& words,
47               Use* use,
48               const cmt_string& file_name,
49               int line_number)
50  {
51    ApplyPattern::action (words, use);
52  }
53};
54
55class KwdApplyTag : public Kwd
56{
57public:
58  void action (const CmtSystem::cmt_string_vector& words,
59               Use* use,
60               const cmt_string& file_name,
61               int line_number)
62  {
63    Tag::action_apply (words, use);
64  }
65};
66
67class KwdAuthor : public Kwd
68{
69public:
70  void action (const CmtSystem::cmt_string_vector& words,
71               Use* use,
72               const cmt_string& file_name,
73               int line_number)
74  {
75    use->author_action (words);
76  }
77};
78
79class KwdBranches : public Kwd
80{
81public:
82  void action (const CmtSystem::cmt_string_vector& words,
83               Use* use,
84               const cmt_string& file_name,
85               int line_number)
86  {
87    if (use == &(Use::current ())) 
88      {
89        Branch::action (words);
90      }
91  }
92};
93
94class KwdBuildStrategy : public Kwd
95{
96public:
97  void action (const CmtSystem::cmt_string_vector& words,
98               Use* use,
99               const cmt_string& file_name,
100               int line_number)
101  {
102    int strategy = Cmt::get_current_build_strategy ();
103
104    for (int i = 1; i < words.size (); i++)
105      {
106        const cmt_string& w = words[i];
107
108        if (w == "prototypes")
109          {
110            strategy |= Prototypes;
111          }
112        else if (w == "no_prototypes")
113          {
114            strategy |= NoPrototypes;
115          }
116        else if (w == "keep_makefiles")
117          {
118            strategy |= KeepMakefiles;
119          }
120        else if (w == "rebuild_makefiles")
121          {
122            strategy |= RebuildMakefiles;
123          }
124        else if (w == "with_install_area")
125          {
126            strategy |= WithInstallArea;
127          }
128        else if (w == "without_install_area")
129          {
130            strategy |= WithoutInstallArea;
131          }
132
133        if ((Cmt::get_action () == action_show_strategies) && !Cmt::get_quiet ())
134          {
135            cout << "# Package " << use->get_package_name ()
136                 << " adds " << w << " to build strategy" << endl;
137          }
138      }
139
140    Cmt::set_current_build_strategy (strategy);
141  }
142};
143
144class KwdCleanupScript : public Kwd
145{
146public:
147  void action (const CmtSystem::cmt_string_vector& words,
148               Use* use,
149               const cmt_string& file_name,
150               int line_number)
151  {
152    Script::action (words, CleanupScript, use);
153    Symbol::action (words, CommandCleanupScript, use);
154  }
155};
156
157class KwdCmtPathPattern : public Kwd
158{
159public:
160  void action (const CmtSystem::cmt_string_vector& words,
161               Use* use,
162               const cmt_string& /*file_name*/,
163               int /*line_number*/)
164  {
165    CmtPathPattern::action (words, use);
166  }
167};
168
169class KwdDocument : public Kwd
170{
171public:
172  void action (const CmtSystem::cmt_string_vector& words,
173               Use* use,
174               const cmt_string& file_name,
175               int line_number)
176  {
177    if (use == &(Use::current ()))
178      {
179        Constituent::action (Document, words);
180      }
181  }
182};
183
184class KwdIgnorePattern : public Kwd
185{
186public:
187  void action (const CmtSystem::cmt_string_vector& words,
188               Use* use,
189               const cmt_string& file_name,
190               int line_number)
191  {
192    IgnorePattern::action (words, use);
193  }
194};
195
196class KwdIncludeDirs : public Kwd
197{
198public:
199  void action (const CmtSystem::cmt_string_vector& words,
200               Use* use,
201               const cmt_string& file_name,
202               int line_number)
203  {
204    Include::action (words, use);
205  }
206};
207
208class KwdIncludePath : public Kwd
209{
210public:
211  void action (const CmtSystem::cmt_string_vector& words,
212               Use* use,
213               const cmt_string& file_name,
214               int line_number)
215  {
216    if (words.size () > 1)
217      {
218        use->set_include_path (words[1]);
219      }
220  }
221};
222
223class KwdLanguage : public Kwd
224{
225public:
226  void action (const CmtSystem::cmt_string_vector& words,
227               Use* use,
228               const cmt_string& file_name,
229               int line_number)
230  {
231    Language::action (words);
232  }
233};
234
235class KwdLibrary : public Kwd
236{
237public:
238  void action (const CmtSystem::cmt_string_vector& words,
239               Use* use,
240               const cmt_string& file_name,
241               int line_number)
242  {
243    if (use == &(Use::current ()))
244      {
245        Constituent::action (Library, words);
246      }
247  }
248};
249
250class KwdMacro : public Kwd
251{
252public:
253  void action (const CmtSystem::cmt_string_vector& words,
254               Use* use,
255               const cmt_string& file_name,
256               int line_number)
257  {
258    Symbol::action (words, CommandMacro, use);
259  }
260};
261
262class KwdMacroPrepend : public Kwd
263{
264public:
265  void action (const CmtSystem::cmt_string_vector& words,
266               Use* use,
267               const cmt_string& file_name,
268               int line_number)
269  {
270    Symbol::action (words, CommandMacroPrepend, use);
271  }
272};
273
274class KwdMacroAppend : public Kwd
275{
276public:
277  void action (const CmtSystem::cmt_string_vector& words,
278               Use* use,
279               const cmt_string& file_name,
280               int line_number)
281  {
282    Symbol::action (words, CommandMacroAppend, use);
283  }
284};
285
286class KwdMacroRemove : public Kwd
287{
288public:
289  void action (const CmtSystem::cmt_string_vector& words,
290               Use* use,
291               const cmt_string& file_name,
292               int line_number)
293  {
294    Symbol::action (words, CommandMacroRemove, use);
295  }
296};
297
298class KwdMacroRemoveAll : public Kwd
299{
300public:
301  void action (const CmtSystem::cmt_string_vector& words,
302               Use* use,
303               const cmt_string& file_name,
304               int line_number)
305  {
306    Symbol::action (words, CommandMacroRemoveAll, use);
307  }
308};
309
310class KwdMakeFragment : public Kwd
311{
312public:
313  void action (const CmtSystem::cmt_string_vector& words,
314               Use* use,
315               const cmt_string& file_name,
316               int line_number)
317  {
318    Fragment::action (words, use);
319  }
320};
321
322class KwdManager : public Kwd
323{
324public:
325  void action (const CmtSystem::cmt_string_vector& words,
326               Use* use,
327               const cmt_string& file_name,
328               int line_number)
329  {
330    use->manager_action (words);
331  }
332};
333
334class KwdPackage : public Kwd
335{
336public:
337  void action (const CmtSystem::cmt_string_vector& words,
338               Use* use,
339               const cmt_string& file_name,
340               int line_number)
341  {
342    /*
343    if (words.size () > 1)
344      {
345        if (use == &(Use::current()))
346          {
347            m_current_package = words[1];
348            build_prefix (m_current_package, m_current_prefix);
349           
350            if ((use->get_package_name () != "") &&
351                (use->get_package_name () != m_current_package))
352              {
353                if (!m_quiet)
354                  {
355                    //  cout << "#CMT> package name mismatch in requirements of " <<
356                    //  use->get_package_name () << " " <<
357                    //  use->version << " line #" << line_number;
358                    //  cout << " : " << m_current_package << " versus " <<
359                    //  use->get_package_name () << endl;
360                  }
361              }
362           
363            use->set (m_current_package,
364                      m_current_version,
365                      m_current_path,
366                      "",
367                      "");
368           
369            use->change_path (m_current_path);
370            use->style = m_current_style;
371          }
372      }
373    */
374  }
375};
376
377class KwdPath : public Kwd
378{
379public:
380  void action (const CmtSystem::cmt_string_vector& words,
381               Use* use,
382               const cmt_string& file_name,
383               int line_number)
384  {
385    Symbol::action (words, CommandPath, use);
386  }
387};
388
389class KwdPathAppend : public Kwd
390{
391public:
392  void action (const CmtSystem::cmt_string_vector& words,
393               Use* use,
394               const cmt_string& file_name,
395               int line_number)
396  {
397    Symbol::action (words, CommandPathAppend, use);
398  }
399};
400
401class KwdPathPrepend : public Kwd
402{
403public:
404  void action (const CmtSystem::cmt_string_vector& words,
405               Use* use,
406               const cmt_string& file_name,
407               int line_number)
408  {
409    Symbol::action (words, CommandPathPrepend, use);
410  }
411};
412
413class KwdPathRemove : public Kwd
414{
415public:
416  void action (const CmtSystem::cmt_string_vector& words,
417               Use* use,
418               const cmt_string& file_name,
419               int line_number)
420  {
421    Symbol::action (words, CommandPathRemove, use);
422  }
423};
424
425class KwdPattern : public Kwd
426{
427public:
428  void action (const CmtSystem::cmt_string_vector& words,
429               Use* use,
430               const cmt_string& file_name,
431               int line_number)
432  {
433    Pattern::action (words, use);
434  }
435};
436
437class KwdPrivate : public Kwd
438{
439public:
440  void action (const CmtSystem::cmt_string_vector& words,
441               Use* use,
442               const cmt_string& file_name,
443               int line_number)
444  {
445    Cmt::set_scope (ScopePrivate);
446  }
447};
448
449class KwdProject : public Kwd
450{
451public:
452  void action (const CmtSystem::cmt_string_vector& words,
453               Use* use,
454               const cmt_string& file_name,
455               int line_number)
456  {
457    Project::action (words, use);
458  }
459};
460
461class KwdPublic : public Kwd
462{
463public:
464  void action (const CmtSystem::cmt_string_vector& words,
465               Use* use,
466               const cmt_string& file_name,
467               int line_number)
468  {
469    Cmt::set_scope (ScopePublic);
470  }
471};
472
473class KwdSet : public Kwd
474{
475public:
476  void action (const CmtSystem::cmt_string_vector& words,
477               Use* use,
478               const cmt_string& file_name,
479               int line_number)
480  {
481    Symbol::action (words, CommandSet, use);
482  }
483};
484
485class KwdSetAppend : public Kwd
486{
487public:
488  void action (const CmtSystem::cmt_string_vector& words,
489               Use* use,
490               const cmt_string& file_name,
491               int line_number)
492  {
493    Symbol::action (words, CommandSetAppend, use);
494  }
495};
496
497class KwdSetPrepend : public Kwd
498{
499public:
500  void action (const CmtSystem::cmt_string_vector& words,
501               Use* use,
502               const cmt_string& file_name,
503               int line_number)
504  {
505    Symbol::action (words, CommandSetPrepend, use);
506  }
507};
508
509class KwdSetRemove : public Kwd
510{
511public:
512  void action (const CmtSystem::cmt_string_vector& words,
513               Use* use,
514               const cmt_string& file_name,
515               int line_number)
516  {
517    Symbol::action (words, CommandSetRemove, use);
518  }
519};
520
521class KwdSetupScript : public Kwd
522{
523public:
524  void action (const CmtSystem::cmt_string_vector& words,
525               Use* use,
526               const cmt_string& file_name,
527               int line_number)
528  {
529    Script::action (words, SetupScript, use);
530    Symbol::action (words, CommandSetupScript, use);
531  }
532};
533
534class KwdSetupStrategy : public Kwd
535{
536public:
537  void action (const CmtSystem::cmt_string_vector& words,
538               Use* use,
539               const cmt_string& file_name,
540               int line_number)
541  {
542    int strategy = Cmt::get_current_setup_strategy ();
543
544    for (int i = 1; i < words.size (); i++)
545      {
546        const cmt_string& w = words[i];
547
548        if (w == "config")
549          {
550            strategy |= SetupConfig;
551          }
552        else if (w == "no_config")
553          {
554            strategy |= SetupNoConfig;
555          }
556        else if (w == "root")
557          {
558            strategy |= SetupRoot;
559          }
560        else if (w == "no_root")
561          {
562            strategy |= SetupNoRoot;
563          }
564        else if (w == "cleanup")
565          {
566            strategy |= SetupCleanup;
567          }
568        else if (w == "no_cleanup")
569          {
570            strategy |= SetupNoCleanup;
571          }
572       
573        if ((Cmt::get_action () == action_show_strategies) && !Cmt::get_quiet ())
574          {
575            cout << "# Package " << use->get_package_name ()
576                 << " adds " << w << " to setup strategy" << endl;
577          }
578      }
579
580    Cmt::set_current_setup_strategy (strategy);
581  }
582};
583
584class KwdTag : public Kwd
585{
586public:
587  void action (const CmtSystem::cmt_string_vector& words,
588               Use* use,
589               const cmt_string& file_name,
590               int line_number)
591  {
592    Tag::action (words, use);
593  }
594};
595
596class KwdTagExclude : public Kwd
597{
598public:
599  void action (const CmtSystem::cmt_string_vector& words,
600               Use* use,
601               const cmt_string& file_name,
602               int line_number)
603  {
604    Tag::action_exclude (words, use);
605  }
606};
607
608class KwdUse : public Kwd
609{
610public:
611  void action (const CmtSystem::cmt_string_vector& words,
612               Use* use,
613               const cmt_string& file_name,
614               int line_number)
615  {
616    Use::action (words, use);
617  }
618};
619
620class KwdVersionStrategy : public Kwd
621{
622public:
623  void action (const CmtSystem::cmt_string_vector& words,
624               Use* use,
625               const cmt_string& file_name,
626               int line_number)
627  {
628    if (words.size () > 1)
629      {
630        const cmt_string& w = words[1];
631       
632        if (w == "best_fit")
633          {
634            Cmt::set_current_strategy (BestFit);
635          }
636        else if (w == "best_fit_no_check")
637          {
638            Cmt::set_current_strategy (BestFitNoCheck);
639          }
640        else if (w == "first_choice")
641          {
642            Cmt::set_current_strategy (FirstChoice);
643          }
644        else if (w == "last_choice")
645          {
646            Cmt::set_current_strategy (LastChoice);
647          }
648        else if (w == "keep_all")
649          {
650            Cmt::set_current_strategy (KeepAll);
651          }
652       
653        if ((Cmt::get_action () == action_show_strategies) && !Cmt::get_quiet ())
654          {
655            cout << "# Package " << use->get_package_name () <<
656              " sets version strategy to " << w << endl;
657          }
658      }
659  }
660};
661
662class KwdVersion : public Kwd
663{
664public:
665  void action (const CmtSystem::cmt_string_vector& words,
666               Use* use,
667               const cmt_string& file_name,
668               int line_number)
669  {
670  }
671};
672
673class KwdDefault : public Kwd
674{
675public:
676  void action (const CmtSystem::cmt_string_vector& words,
677               Use* use,
678               const cmt_string& file_name,
679               int line_number)
680  {
681    /*
682      Unknown keyword : just ignore the line
683    */
684    if (!Cmt::get_quiet ())
685      {
686        cout << "#CMT> bad syntax in requirements of " << use->get_package_name ()
687             << " " << use->version << " line #" << line_number;
688        cout << " [" << words[0] << "...]" << endl;
689      }
690   
691    CmtError::set (CmtError::syntax_error, "ParseRequirements> ");
692  }
693};
694
695SyntaxParser& SyntaxParser::instance ()
696{
697  static SyntaxParser p;
698
699  return (p);
700}
701
702/**
703 *  Parse the input file, rejecting comments and
704 * rebuilding complete lines (from sections separated by
705 *  \ characters.
706 *
707 *  Each reformatted line is parsed by filter_line
708 */
709void SyntaxParser::parse_requirements (const cmt_string& file_name, Use* use)
710{
711  SyntaxParser& me = instance ();
712  me.do_parse_requirements (file_name, use);
713}
714
715/**
716 *  Parse a text, rejecting comments and
717 * rebuilding complete lines (from sections separated by
718 *  \ characters.
719 *
720 *  Each reformatted line is parsed by filter_line
721 */
722void SyntaxParser::parse_requirements_text (const cmt_string& text,
723                                            const cmt_string& file_name,
724                                            Use* use)
725{
726  SyntaxParser& me = instance ();
727
728    /**
729     *
730     *    We have to preserve m_current_access since it reflects whether
731     *   the current cmt action is run in the context of the current package.
732     *   (the opposite is when the cmt command specifies the current package
733     *    in its arguments -use=... therefore the pwd is NOT the directory
734     *    of the current package)
735     *
736     *   m_current_access is Developer when pwd =  current
737     *                       User      when pwd != current
738     *
739     *    Therefore, as soon as we reach a used package, this must be switched to User
740     *
741     *   On the other hand, Cmt::scope reflects the status of the public/private
742     *  statements. By default, we are in public context when entering a new requirements
743     *  file.
744     *
745     */
746
747  AccessMode saved_current_access;
748  ScopeType saved_scope;
749
750  saved_current_access = Cmt::get_current_access ();
751  saved_scope          = Cmt::get_scope ();
752
753  if (use == 0) use = &(Use::current ());
754
755  if (use != &(Use::current ()))
756    {
757      Cmt::set_current_access (UserMode);
758    }
759  else
760    {
761      Cmt::set_current_access (DeveloperMode);
762    }
763
764  Cmt::set_scope (ScopePublic);
765
766  me.do_parse_requirements_text (text, file_name, use);
767
768  Cmt::set_current_access (saved_current_access);
769  Cmt::set_scope (saved_scope);
770}
771
772/**
773 *  Apply the basic parser to one single line :
774 *
775 *   o Append to global text if previous back_slash
776 *   o Split into words
777 *   o Apply the generic Select operator
778 */
779void SyntaxParser::parse_requirements_line (const cmt_string& line,
780                                            Use* use,
781                                            const cmt_string& file_name,
782                                            int line_number)
783{
784  SyntaxParser& me = instance ();
785  me.do_parse_requirements_line (line, use, file_name, line_number);
786}
787
788void SyntaxParser::parse (const CmtSystem::cmt_string_vector& words,
789                          Use* use,
790                          const cmt_string& file_name,
791                          int line_number)
792{
793  SyntaxParser& me = instance ();
794  me.do_parse (words, use, file_name, line_number);
795}
796
797SyntaxParser::SyntaxParser ()
798{
799  m_keywords.add ("alias", new KwdAlias ());
800  m_keywords.add ("application", new KwdApplication ());
801  m_keywords.add ("apply_pattern", new KwdApplyPattern ());
802  m_keywords.add ("apply_tag", new KwdApplyTag ());
803  m_keywords.add ("author", new KwdAuthor ());
804  m_keywords.add ("branches", new KwdBranches ());
805  m_keywords.add ("build_strategy", new KwdBuildStrategy ());
806  m_keywords.add ("cleanup_script", new KwdCleanupScript ());
807  m_keywords.add ("cmtpath_pattern", new KwdCmtPathPattern ());
808  m_keywords.add ("document", new KwdDocument ());
809  m_keywords.add ("ignore_pattern", new KwdIgnorePattern ());
810  m_keywords.add ("include_dirs", new KwdIncludeDirs ());
811  m_keywords.add ("include_path", new KwdIncludePath ());
812  m_keywords.add ("language", new KwdLanguage ());
813  m_keywords.add ("library", new KwdLibrary ());
814  m_keywords.add ("macro", new KwdMacro ());
815  m_keywords.add ("macro+", new KwdMacroAppend ());
816  m_keywords.add ("macro_prepend", new KwdMacroPrepend ());
817  m_keywords.add ("macro_append", new KwdMacroAppend ());
818  m_keywords.add ("macro_remove", new KwdMacroRemove ());
819  m_keywords.add ("macro_remove_all", new KwdMacroRemoveAll ());
820  m_keywords.add ("make_fragment", new KwdMakeFragment ());
821  m_keywords.add ("manager", new KwdManager ());
822  m_keywords.add ("package", new KwdPackage ());
823  m_keywords.add ("path", new KwdPath ());
824  m_keywords.add ("path_append", new KwdPathAppend ());
825  m_keywords.add ("path_prepend", new KwdPathPrepend ());
826  m_keywords.add ("path_remove", new KwdPathRemove ());
827  m_keywords.add ("pattern", new KwdPattern ());
828  m_keywords.add ("public", new KwdPublic ());
829  m_keywords.add ("private", new KwdPrivate ());
830  m_keywords.add ("project", new KwdProject ());
831  m_keywords.add ("set", new KwdSet ());
832  m_keywords.add ("set_append", new KwdSetAppend ());
833  m_keywords.add ("set_prepend", new KwdSetPrepend ());
834  m_keywords.add ("set_remove", new KwdSetRemove ());
835  m_keywords.add ("setup_script", new KwdSetupScript ());
836  m_keywords.add ("setup_strategy", new KwdSetupStrategy ());
837  m_keywords.add ("tag", new KwdTag ());
838  m_keywords.add ("tag_exclude", new KwdTagExclude ());
839  m_keywords.add ("use", new KwdUse ());
840  m_keywords.add ("version_strategy", new KwdVersionStrategy ());
841  m_keywords.add ("version", new KwdVersion ());
842}
843
844void SyntaxParser::do_parse (const CmtSystem::cmt_string_vector& words,
845                             Use* use,
846                             const cmt_string& file_name,
847                             int line_number)
848{
849  CmtError::clear ();
850
851  if (words.size () == 0) return;
852
853  const cmt_string& command = words[0];
854
855  if (command.size () == 0) return;
856
857  //
858  // First analyze the syntax
859  //
860
861  Kwd* keyword = m_keywords.find (command);
862  if (keyword == 0)
863    {
864      CmtError::set (CmtError::syntax_error, "ParseRequirements> ");
865    }
866
867  if (CmtError::has_pending_error ())
868    {
869      if (!Cmt::get_quiet ())
870        {
871          cout << "#CMT> bad syntax in requirements of " << use->get_package_name ()
872               << " " << use->version
873               << " " << use->specified_path
874               << " line #" << line_number;
875          cout << " [" << command << " ...]" << endl;
876        }
877
878      return;
879    }
880
881  //
882  // Then interpret the action
883  //
884
885  keyword->action (words, use, file_name, line_number);
886}
887
888void SyntaxParser::do_parse_requirements (const cmt_string& file_name, Use* use)
889{
890  cmt_string actual_file_name = file_name;
891  cmt_string text;
892
893  CmtError::clear ();
894
895  if (!CmtSystem::test_file (actual_file_name))
896    {
897      actual_file_name = "..";
898      actual_file_name += CmtSystem::file_separator ();
899      actual_file_name += "cmt";
900      actual_file_name += CmtSystem::file_separator ();
901      actual_file_name += file_name;
902
903      if (!CmtSystem::test_file (actual_file_name))
904        {
905          actual_file_name = "..";
906          actual_file_name += CmtSystem::file_separator ();
907          actual_file_name += "mgr";
908          actual_file_name += CmtSystem::file_separator ();
909          actual_file_name += file_name;
910
911          if (!CmtSystem::test_file (actual_file_name))
912            {
913              return;
914            }
915        }
916    }
917
918  text.read (actual_file_name);
919
920  SyntaxParser::parse_requirements_text (text, actual_file_name, use);
921
922    //Pattern::apply_all_globals (use);
923}
924
925void SyntaxParser::do_parse_requirements_line (const cmt_string& line,
926                                               Use* use,
927                                               const cmt_string& file_name,
928                                               int line_number)
929{
930  int length;
931  int nl;
932  int back_slash;
933  cmt_string temp_line = line;
934
935  if (temp_line.size () == 0) return;
936  if (temp_line[0] == '#') return;
937
938  nl = temp_line.find_last_of ('\n');
939  if (nl != cmt_string::npos) temp_line.erase (nl);
940
941  length = temp_line.size ();
942  if (length == 0) return;
943
944  //
945  // We scan the line for handling backslashes.
946  //
947  // o Really terminating backslashes (ie those only followed by spaces/tabs
948  // mean continued line
949  //
950  //
951
952  bool finished = true;
953
954  length = temp_line.size ();
955
956  back_slash = temp_line.find_last_of ('\\');
957
958  if (back_slash != cmt_string::npos)
959    {
960      //
961      // This is the last backslash
962      // check if there are only space chars after it
963      //
964     
965      bool at_end = true;
966
967      for (int i = (back_slash + 1); i < length; i++)
968        {
969          char c = temp_line[i];
970          if ((c != ' ') && (c != '\t'))
971            {
972              at_end = false;
973              break;
974            }
975        }
976
977      if (at_end)
978        {
979          temp_line.erase (back_slash);
980          finished = false;
981        }
982      else
983        {
984          // This was not a trailing backslash.
985          finished = true;
986        }
987    }
988
989  m_filtered_text += temp_line;
990
991  if (!finished)
992    {
993      // We still need to accumulate forthcoming lines
994      // before parsing the resulting text.
995      return;
996    }
997
998  /*
999    Here a full line (possibly accumulating several lines
1000    ended by backslashes) is parsed :
1001   
1002    o Special characters are filtered now :
1003   
1004    <cmt:tab/>  \t
1005    <cmt:cr/>   \r
1006    <cmt:lf/>   \n
1007   
1008    o Split into words (a word is a string not containing
1009    spaces or enclosed in quotes)
1010
1011    o Parse the word array (function Select)
1012
1013  */
1014
1015  m_filtered_text.replace_all ("<cmt:tab/>", "\t");
1016  m_filtered_text.replace_all ("<cmt:cr/>",  "\r");
1017  m_filtered_text.replace_all ("<cmt:lf/>",  "\n");
1018
1019  if (Cmt::get_debug ())
1020    {
1021      cout << "parse_requirements_line [" << m_filtered_text << "]" << endl;
1022    }
1023 
1024  static CmtSystem::cmt_string_vector words;
1025 
1026  CmtSystem::split (m_filtered_text, " \t", words);
1027 
1028  if (words.size () != 0)
1029    {
1030      static SyntaxParser& parser = SyntaxParser::instance ();
1031
1032      parser.parse (words, use, file_name, line_number);
1033    }
1034 
1035  m_filtered_text.erase (0);
1036}
1037
1038/**
1039 *  Parse a text, rejecting comments and
1040 * rebuilding complete lines (from sections separated by
1041 *  \ characters.
1042 *
1043 *  Each reformatted line is parsed by filter_line
1044 */
1045void SyntaxParser::do_parse_requirements_text (const cmt_string& text,
1046                                               const cmt_string& file_name,
1047                                               Use* use)
1048{
1049  cmt_string line;
1050  int pos;
1051  int max_pos;
1052  int line_number = 1;
1053
1054  if (use == 0) use = &(Use::current ());
1055
1056  m_filtered_text.erase (0);
1057
1058  pos = 0;
1059  max_pos = text.size ();
1060
1061  for (pos = 0; pos < max_pos;)
1062    {
1063      int cr = text.find (pos, "\r\n");
1064      int nl = text.find (pos, '\n');
1065      int first = nl;
1066      int length = 1;
1067
1068      if (cr != cmt_string::npos)
1069        {
1070          if (nl == cmt_string::npos)
1071            {
1072              first = cr;
1073              length = 2;
1074            }
1075          else
1076            {
1077              first = (nl < cr) ? nl : cr;
1078              length = (nl < cr) ? 1 : 2;
1079            }
1080        }
1081
1082      if (first == cmt_string::npos)
1083        {
1084          text.substr (pos, line);
1085          pos = max_pos;
1086        }
1087      else if (first > pos)
1088        {
1089          text.substr (pos, first - pos, line);
1090          pos = first + length;
1091        }
1092      else
1093        {
1094          line.erase (0);
1095          pos += length;
1096        }
1097
1098      parse_requirements_line (line, use, file_name, line_number);
1099
1100      if ((Cmt::get_action () == action_check_configuration) && CmtError::has_pending_error ())
1101        {
1102          break;
1103        }
1104
1105      line_number++;
1106    }
1107}
1108
1109
1110
1111
1112/*
1113
1114class Cmd
1115{
1116public:
1117  virtual void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments) = 0;
1118}
1119
1120class CmdAwk : public Cmd
1121{
1122public:
1123  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1124  {
1125    argc--;
1126    argv++;
1127    while (argc > 1)
1128      {
1129        cmt_string& s = arguments.add ();
1130        s = argv[1];
1131        argc--;
1132        argv++;
1133      }
1134
1135    m_action = action_awk;
1136  }
1137}
1138
1139class CmdBroadcast : public Cmd
1140{
1141public:
1142  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1143  {
1144    argc--;
1145    argv++;
1146    while (argc > 1)
1147      {
1148        cmt_string& s = arguments.add ();
1149        s = argv[1];
1150        argc--;
1151        argv++;
1152      }
1153
1154    m_action = action_broadcast;
1155  }
1156}
1157
1158class Cmd : public Cmd
1159{
1160public:
1161  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1162  {
1163  }
1164}
1165
1166class Cmd : public Cmd
1167{
1168public:
1169  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1170  {
1171  }
1172}
1173
1174class Cmd : public Cmd
1175{
1176public:
1177  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1178  {
1179  }
1180}
1181
1182class Cmd : public Cmd
1183{
1184public:
1185  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1186  {
1187  }
1188}
1189
1190class Cmd : public Cmd
1191{
1192public:
1193  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1194  {
1195  }
1196}
1197
1198class Cmd : public Cmd
1199{
1200public:
1201  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1202  {
1203  }
1204}
1205
1206class Cmd : public Cmd
1207{
1208public:
1209  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1210  {
1211  }
1212}
1213
1214class Cmd : public Cmd
1215{
1216public:
1217  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1218  {
1219  }
1220}
1221
1222class Cmd : public Cmd
1223{
1224public:
1225  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1226  {
1227  }
1228}
1229
1230class Cmd : public Cmd
1231{
1232public:
1233  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1234  {
1235  }
1236}
1237
1238class Cmd : public Cmd
1239{
1240public:
1241  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1242  {
1243  }
1244}
1245
1246class Cmd : public Cmd
1247{
1248public:
1249  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1250  {
1251  }
1252}
1253
1254class Cmd : public Cmd
1255{
1256public:
1257  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1258  {
1259  }
1260}
1261
1262class Cmd : public Cmd
1263{
1264public:
1265  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1266  {
1267  }
1268}
1269
1270class Cmd : public Cmd
1271{
1272public:
1273  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1274  {
1275  }
1276}
1277
1278class Cmd : public Cmd
1279{
1280public:
1281  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1282  {
1283  }
1284}
1285
1286class Cmd : public Cmd
1287{
1288public:
1289  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1290  {
1291  }
1292}
1293
1294class Cmd : public Cmd
1295{
1296public:
1297  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1298  {
1299  }
1300}
1301
1302class Cmd : public Cmd
1303{
1304public:
1305  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1306  {
1307  }
1308}
1309
1310class Cmd : public Cmd
1311{
1312public:
1313  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1314  {
1315  }
1316}
1317
1318class Cmd : public Cmd
1319{
1320public:
1321  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1322  {
1323  }
1324}
1325
1326class Cmd : public Cmd
1327{
1328public:
1329  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1330  {
1331  }
1332}
1333
1334class Cmd : public Cmd
1335{
1336public:
1337  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1338  {
1339  }
1340}
1341
1342class Cmd : public Cmd
1343{
1344public:
1345  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1346  {
1347  }
1348}
1349
1350class Cmd : public Cmd
1351{
1352public:
1353  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1354  {
1355  }
1356}
1357
1358class Cmd : public Cmd
1359{
1360public:
1361  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1362  {
1363  }
1364}
1365
1366class Cmd : public Cmd
1367{
1368public:
1369  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1370  {
1371  }
1372}
1373
1374class Cmd : public Cmd
1375{
1376public:
1377  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1378  {
1379  }
1380}
1381
1382class Cmd : public Cmd
1383{
1384public:
1385  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1386  {
1387  }
1388}
1389
1390class Cmd : public Cmd
1391{
1392public:
1393  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1394  {
1395  }
1396}
1397
1398class Cmd : public Cmd
1399{
1400public:
1401  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1402  {
1403  }
1404}
1405
1406class Cmd : public Cmd
1407{
1408public:
1409  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1410  {
1411  }
1412}
1413
1414class Cmd : public Cmd
1415{
1416public:
1417  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1418  {
1419  }
1420}
1421
1422class Cmd : public Cmd
1423{
1424public:
1425  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1426  {
1427  }
1428}
1429
1430class Cmd : public Cmd
1431{
1432public:
1433  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1434  {
1435  }
1436}
1437
1438class Cmd : public Cmd
1439{
1440public:
1441  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1442  {
1443  }
1444}
1445
1446class Cmd : public Cmd
1447{
1448public:
1449  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1450  {
1451  }
1452}
1453
1454class Cmd : public Cmd
1455{
1456public:
1457  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1458  {
1459  }
1460}
1461
1462class Cmd : public Cmd
1463{
1464public:
1465  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1466  {
1467  }
1468}
1469
1470class Cmd : public Cmd
1471{
1472public:
1473  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1474  {
1475  }
1476}
1477
1478class Cmd : public Cmd
1479{
1480public:
1481  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1482  {
1483  }
1484}
1485
1486class Cmd : public Cmd
1487{
1488public:
1489  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1490  {
1491  }
1492}
1493
1494class Cmd : public Cmd
1495{
1496public:
1497  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1498  {
1499  }
1500}
1501
1502class Cmd : public Cmd
1503{
1504public:
1505  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1506  {
1507  }
1508}
1509
1510class Cmd : public Cmd
1511{
1512public:
1513  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1514  {
1515  }
1516}
1517
1518class Cmd : public Cmd
1519{
1520public:
1521  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1522  {
1523  }
1524}
1525
1526class Cmd : public Cmd
1527{
1528public:
1529  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1530  {
1531  }
1532}
1533
1534class Cmd : public Cmd
1535{
1536public:
1537  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1538  {
1539  }
1540}
1541
1542class Cmd : public Cmd
1543{
1544public:
1545  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1546  {
1547  }
1548}
1549
1550class Cmd : public Cmd
1551{
1552public:
1553  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1554  {
1555  }
1556}
1557
1558class Cmd : public Cmd
1559{
1560public:
1561  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1562  {
1563  }
1564}
1565
1566class Cmd : public Cmd
1567{
1568public:
1569  void action (int argc, char* argv[], CmtSystem::cmt_string_vector& arguments)
1570  {
1571  }
1572}
1573
1574*/
1575
1576CommandParser::HelpMap& CommandParser::get_help ()
1577{
1578  static CommandParser& me = instance ();
1579
1580  return (me.m_help);
1581}
1582
1583CommandParser::HelpTexts& CommandParser::get_help_texts ()
1584{
1585  static CommandParser& me = instance ();
1586
1587  return (me.m_help_texts);
1588}
1589
1590const cmt_string& CommandParser::get_help_text (ActionType key)
1591{
1592  static const HelpTexts& help = get_help_texts ();
1593
1594  const cmt_string& h = help[key];
1595  return (h);
1596}
1597
1598void CommandParser::show_all ()
1599{
1600  static HelpTexts& help_texts = get_help_texts ();
1601
1602  cout << "> cmt command [option...]" << endl;
1603  cout << " command :" << endl;
1604
1605  int i;
1606
1607  for (i = 0; ; i++)
1608    {
1609      const cmt_string& s = help_texts[i];
1610      if (s == "") break;
1611      cout << "   " << s << endl;
1612    }
1613
1614  cout << " global options :" << endl;
1615
1616  cout << "   -quiet                  : don't print errors" << endl;
1617  cout << "   -use=<p>:<v>:<path>     : set package version path" << endl;
1618  cout << "   -pack=<package>         : set package" << endl;
1619  cout << "   -version=<version>      : set version" << endl;
1620  cout << "   -path=<path>            : set root path" << endl;
1621  cout << "   -f=<requirement-file>   : set input file" << endl;
1622  cout << "   -e=<statement>          : add a one line statement" << endl;
1623  cout << "   -tag=<tag-list>         : select a new tag-set" << endl;
1624  cout << "   -tag_add=<tag-list>     : add specific comma-separated tag(s)" << endl;
1625  cout << "   -tag_remove=<tag-list>  : remove specific comma-separated tag(s)" << endl;
1626  cout << "   -with_version_directory : reset to default structuring style" << endl;
1627  cout << "   -without_version_directory : switch structuring style" << endl;
1628  cout << "   -cleanup                : activate install area cleanup" << endl;
1629  cout << "   -no_cleanup             : inhibit install area cleanup" << endl;
1630}
1631
1632void CommandParser::show (ActionType action)
1633{
1634  static HelpTexts& help_texts = get_help_texts ();
1635
1636  if (action == action_build)
1637    {
1638      int i;
1639
1640      for (i = action_build_constituent_makefile; i <= action_build_windefs; i++)
1641        {
1642          const cmt_string& s = help_texts[i];
1643          cout << "   " << s << endl;
1644        }
1645    }
1646  if (action == action_check)
1647    {
1648      int i;
1649
1650      for (i = action_check_configuration; i <= action_check_version; i++)
1651        {
1652          const cmt_string& s = help_texts[i];
1653          cout << "   " << s << endl;
1654        }
1655    }
1656  else if (action == action_show)
1657    {
1658      int i;
1659
1660      for (i = action_show_all_tags; i <= action_show_versions; i++)
1661        {
1662          const cmt_string& s = help_texts[i];
1663          cout << "   " << s << endl;
1664        }
1665    }
1666  else
1667    {
1668      const cmt_string& s = get_help_text (action);
1669      cout << s << endl;
1670    }
1671}
1672
1673CommandParser& CommandParser::instance ()
1674{
1675  static CommandParser me;
1676  return (me);
1677}
1678
1679CommandParser::CommandParser ()
1680{
1681  static HelpMap& help = m_help;
1682
1683  static HelpTexts& help_texts = m_help_texts;
1684
1685  help_texts.clear ();
1686
1687  help_texts.add () =  "none";
1688  help_texts.add () =  "awk";
1689  help_texts.add () =  "broadcast [-select=list] [-exclude=list] [-local] [-global] [-begin=pattern] [-depth=n] <command> : apply a command to [some of] the used packages";
1690  help_texts.add () =  "build <option>          : build actions. (Try cmt help build)";
1691  help_texts.add () =  "build constituent_makefile <constituent>  : generate constituent Makefile fragment";
1692  help_texts.add () =  "build constituents_makefile : generate constituents.make";
1693  help_texts.add () =  "build dependencies      : generate dependencies";
1694  help_texts.add () =  "build library_links     : build symbolic links towards all imported libraries";
1695  help_texts.add () =  "build make_setup        : build a compiled version of setup scripts";
1696  help_texts.add () =  "build msdev             : generate MSDEV files";
1697  help_texts.add () =  "build CMT_pacman        : generate PACMAN manifest file for CMT";
1698  help_texts.add () =  "build vsnet             : generate VS.NET files";
1699  help_texts.add () =  "build os9_makefile      : generate Makefile for OS9";
1700  help_texts.add () =  "build prototype         : generate prototype file";
1701  help_texts.add () =  "build readme            : generate README.html";
1702  help_texts.add () =  "build tag_makefile      : generate tag specific Makefile";
1703  help_texts.add () =  "build temporary_name    : generate a name for a temprary file";
1704  help_texts.add () =  "build triggers <constituent> : generate library trigger file";
1705  help_texts.add () =  "build windefs <library_name> : generate def file for Windows shared libraries";
1706  help_texts.add () =  "check <option>          : check actions. (Try cmt help check)";
1707  help_texts.add () =  "check configuration     : check configuration";
1708  help_texts.add () =  "check files <old> <new> : compare two files and overrides <old> by <new> if different";
1709  help_texts.add () =  "check version <name>    : check if a name follows a version tag syntax ";
1710  help_texts.add () =  "co | checkout           : perform a cvs checkout over a CMT package";
1711  help_texts.add () =  "cleanup [-csh|-sh|-bat] : generate a cleanup script";
1712  help_texts.add () =  "config                  : generate setup and cleanup scripts";
1713  help_texts.add () =  "create <package> <version> [<path>] : create and configure a new package";
1714  help_texts.add () =  "cvsbranches <module>      : display the subdirectories for a module";
1715  help_texts.add () =  "cvssubpackagess <module>  : display the subpackages for a module";
1716  help_texts.add () =  "cvstags <module>          : display the CVS tags for a module";
1717  help_texts.add () =  "expand model <model>    : ";
1718  help_texts.add () =  "filter <in> <out>       : filter a file against CMT macros and env. variables";
1719  help_texts.add () =  "help | -help | --help   : display this help";
1720  help_texts.add () =  "load";
1721  help_texts.add () =  "lock [<p> <v> [<path>]] : lock a package";
1722  help_texts.add () =  "remove <package> <version> [<path>] : remove a package version";
1723  help_texts.add () =  "remove library_links    : remove symbolic links towards all imported libraries";
1724  help_texts.add () =  "run '<command>'         : apply a command";
1725  help_texts.add () =  "run_sequence <sequence file> : execute a cmt equence file";
1726  help_texts.add () =  "set version <version>   : generate a version file in the current package";
1727  help_texts.add () =  "set versions            : generate version files into packages";
1728  help_texts.add () =  "setup [-csh|-sh|-bat]   : generate a setup script";
1729  help_texts.add () =  "show <option>           : query actions. (Try cmt help show)";
1730  help_texts.add () =  "show  all_tags          :  all defined tags";
1731  help_texts.add () =  "show  applied_patterns  :  all patterns actually applied";
1732  help_texts.add () =  "show  author            :  package author";
1733  help_texts.add () =  "show  branches          :  added branches";
1734  help_texts.add () =  "show  clients           :  package clients";
1735  help_texts.add () =  "show  cmtpath_patterns  :  cmtpath_patterns";
1736  help_texts.add () =  "show  constituent <name>:  constituent definition";
1737  help_texts.add () =  "show  constituent_names :  constituent names";
1738  help_texts.add () =  "show  constituents      :  constituent definitions";
1739  help_texts.add () =  "show  cycles            :  cycles in the use graph";
1740  help_texts.add () =  "show  fragment <name>   :  one fragment definition";
1741  help_texts.add () =  "show  fragments         :  fragment definitions";
1742  help_texts.add () =  "show  groups            :  group definitions";
1743  help_texts.add () =  "show  include_dirs      :  ";
1744  help_texts.add () =  "show  language <name>   :  language definition";
1745  help_texts.add () =  "show  languages         :  language definitions";
1746  help_texts.add () =  "show  macro <name>      :  a formatted macro definition";
1747  help_texts.add () =  "show  macro_value <name>  :  a raw macro definition";
1748  help_texts.add () =  "show  macro_names       :  all macro names";
1749  help_texts.add () =  "show  macros            :  all macro definitions";
1750  help_texts.add () =  "show  manager           :  package manager";
1751  help_texts.add () =  "show  packages          :  packages reachable from the current context";
1752  help_texts.add () =  "show  path              :  the package search list";
1753  help_texts.add () =  "show  pattern <name>    :  the pattern definition and usages";
1754  help_texts.add () =  "show  pattern_names     :  pattern names";
1755  help_texts.add () =  "show  patterns          :  the pattern definitions";
1756  help_texts.add () =  "show  projects          :  project definitions";
1757  help_texts.add () =  "show  pwd               :  filtered current directory";
1758  help_texts.add () =  "show  set <name>        :  a formatted set definition";
1759  help_texts.add () =  "show  set_names         :  set names";
1760  help_texts.add () =  "show  set_value <name>  :  a raw set definition";
1761  help_texts.add () =  "show  sets              :  set definitions";
1762  help_texts.add () =  "show  strategies        :  all strategies (build & version)";
1763  help_texts.add () =  "show  tags              :  all currently active tags";
1764  help_texts.add () =  "show  use_paths <pack>  :  all paths to the used package";
1765  help_texts.add () =  "show  uses              :  used packages";
1766  help_texts.add () =  "show  version           :  version of the current package";
1767  help_texts.add () =  "show  versions <name>   :  visible versions of the selected package";
1768  help_texts.add () =  "system                  : display the system tag";
1769  help_texts.add () =  "unlock [<p> <v> [<path>]] : unlock a package";
1770  help_texts.add () =  "version                 : version of CMT";
1771  help_texts.add () =  "";
1772
1773  //"build <key>             : build various components :"
1774  //"show <key>              : display various infos on :"
1775
1776  help.add (action_none, help_texts[action_none]);
1777  help.add (action_awk, help_texts[action_awk]);
1778  help.add (action_broadcast, help_texts[action_broadcast]);
1779  help.add (action_build, help_texts[action_build]);
1780  help.add (action_build_constituent_makefile, help_texts[action_build_constituent_makefile]);
1781  help.add (action_build_constituents_makefile, help_texts[action_build_constituents_makefile]);
1782  help.add (action_build_dependencies, help_texts[action_build_dependencies]);
1783  help.add (action_build_library_links, help_texts[action_build_library_links]);
1784  help.add (action_build_make_setup, help_texts[action_build_make_setup]);
1785  help.add (action_build_msdev, help_texts[action_build_msdev]);
1786  help.add (action_build_CMT_pacman, help_texts[action_build_CMT_pacman]);
1787  help.add (action_build_vsnet, help_texts[action_build_vsnet]);
1788  help.add (action_build_os9_makefile, help_texts[action_build_os9_makefile]);
1789  help.add (action_build_prototype, help_texts[action_build_prototype]);
1790  help.add (action_build_readme, help_texts[action_build_readme]);
1791  help.add (action_build_tag_makefile, help_texts[action_build_tag_makefile]);
1792  help.add (action_build_temporary_name, help_texts[action_build_temporary_name]);
1793  help.add (action_build_triggers, help_texts[action_build_triggers]);
1794  help.add (action_build_windefs, help_texts[action_build_windefs]);
1795  help.add (action_check_configuration, help_texts[action_check_configuration]);
1796  help.add (action_check_files, help_texts[action_check_files]);
1797  help.add (action_check_version, help_texts[action_check_version]);
1798  help.add (action_checkout, help_texts[action_checkout]);
1799  help.add (action_cleanup, help_texts[action_cleanup]);
1800  help.add (action_config, help_texts[action_config]);
1801  help.add (action_create, help_texts[action_create]);
1802  help.add (action_cvsbranches, help_texts[action_cvsbranches]);
1803  help.add (action_cvssubpackages, help_texts[action_cvssubpackages]);
1804  help.add (action_cvstags, help_texts[action_cvstags]);
1805  help.add (action_expand_model, help_texts[action_expand_model]);
1806  help.add (action_filter, help_texts[action_filter]);
1807  help.add (action_help, help_texts[action_help]);
1808  help.add (action_load, help_texts[action_load]);
1809  help.add (action_lock, help_texts[action_lock]);
1810  help.add (action_remove, help_texts[action_remove]);
1811  help.add (action_remove_library_links, help_texts[action_remove_library_links]);
1812  help.add (action_run, help_texts[action_run]);
1813  help.add (action_run_sequence, help_texts[action_run_sequence]);
1814  help.add (action_set_version, help_texts[action_set_version]);
1815  help.add (action_set_versions, help_texts[action_set_versions]);
1816  help.add (action_setup, help_texts[action_setup]);
1817  help.add (action_show, help_texts[action_show]);
1818  help.add (action_show_all_tags, help_texts[action_show_all_tags]);
1819  help.add (action_show_applied_patterns, help_texts[action_show_applied_patterns]);
1820  help.add (action_show_author, help_texts[action_show_author]);
1821  help.add (action_show_branches, help_texts[action_show_branches]);
1822  help.add (action_show_clients, help_texts[action_show_clients]);
1823  help.add (action_show_cmtpath_patterns, help_texts[action_show_cmtpath_patterns]);
1824  help.add (action_show_constituent, help_texts[action_show_constituent]);
1825  help.add (action_show_constituent_names, help_texts[action_show_constituent_names]);
1826  help.add (action_show_constituents, help_texts[action_show_constituents]);
1827  help.add (action_show_cycles, help_texts[action_show_cycles]);
1828  help.add (action_show_fragment, help_texts[action_show_fragment]);
1829  help.add (action_show_fragments, help_texts[action_show_fragments]);
1830  help.add (action_show_groups, help_texts[action_show_groups]);
1831  help.add (action_show_include_dirs, help_texts[action_show_include_dirs]);
1832  help.add (action_show_language, help_texts[action_show_language]);
1833  help.add (action_show_languages, help_texts[action_show_languages]);
1834  help.add (action_show_macro, help_texts[action_show_macro]);
1835  help.add (action_show_macro_value, help_texts[action_show_macro_value]);
1836  help.add (action_show_macro_names, help_texts[action_show_macro_names]);
1837  help.add (action_show_macros, help_texts[action_show_macros]);
1838  help.add (action_show_manager, help_texts[action_show_manager]);
1839  help.add (action_show_packages, help_texts[action_show_packages]);
1840  help.add (action_show_path, help_texts[action_show_path]);
1841  help.add (action_show_pattern, help_texts[action_show_pattern]);
1842  help.add (action_show_pattern_names, help_texts[action_show_pattern_names]);
1843  help.add (action_show_patterns, help_texts[action_show_patterns]);
1844  help.add (action_show_projects, help_texts[action_show_projects]);
1845  help.add (action_show_pwd, help_texts[action_show_pwd]);
1846  help.add (action_show_set, help_texts[action_show_set]);
1847  help.add (action_show_set_names, help_texts[action_show_set_names]);
1848  help.add (action_show_set_value, help_texts[action_show_set_value]);
1849  help.add (action_show_sets, help_texts[action_show_sets]);
1850  help.add (action_show_strategies, help_texts[action_show_strategies]);
1851  help.add (action_show_tags, help_texts[action_show_tags]);
1852  help.add (action_show_use_paths, help_texts[action_show_use_paths]);
1853  help.add (action_show_uses, help_texts[action_show_uses]);
1854  help.add (action_show_version, help_texts[action_show_version]);
1855  help.add (action_show_versions, help_texts[action_show_versions]);
1856  help.add (action_system, help_texts[action_system]);
1857  help.add (action_unlock, help_texts[action_unlock]);
1858  help.add (action_version, help_texts[action_version]);
1859}
1860
Note: See TracBrowser for help on using the repository browser.