Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

TriggerAnalyzer Class Reference

Inheritance diagram for TriggerAnalyzer

Inheritance graph
[legend]
Collaboration diagram for TriggerAnalyzer:

Collaboration graph
[legend]
List of all members.

Public Methods

 TriggerAnalyzer (const cmt_string& package_name)
void begin ()
void filter (const cmt_string& line)
void end ()

Private Attributes

cmt_string package

Constructor & Destructor Documentation

TriggerAnalyzer::TriggerAnalyzer ( const cmt_string & package_name )
 

Definition at line 229 of file cmt_triggers.cxx.

00229                                                                 :
00230   package (package_name)
00231 {
00232 }


Member Function Documentation

void TriggerAnalyzer::begin ( ) [virtual]
 

Reimplemented from Awk.

Definition at line 234 of file cmt_triggers.cxx.

00235 {
00236 }

void TriggerAnalyzer::end ( ) [virtual]
 

Reimplemented from Awk.

Definition at line 301 of file cmt_triggers.cxx.

00302 {
00303 }

void TriggerAnalyzer::filter ( const cmt_string & line ) [virtual]
 

Reimplemented from Awk.

Definition at line 238 of file cmt_triggers.cxx.

00239 {
00240   int pos = line.find ("=");
00241   if (pos == 0)
00242     {
00243       if (!Cmt::get_quiet ())
00244         {
00245           cerr << "Syntax error in trigger file : empty name" << endl;
00246         }
00247       exit (0);
00248     }
00249   if (pos == cmt_string::npos)
00250     {
00251       if (!Cmt::get_quiet ())
00252         {
00253           cerr << "Syntax error in trigger file : no = sign" << endl;
00254         }
00255       exit (0);
00256     }
00257 
00258   cmt_string name;
00259   cmt_string text;
00260   CmtSystem::cmt_string_vector words;
00261 
00262   line.substr (0, pos, name);
00263   line.substr (pos + 1, text);
00264   CmtSystem::split (text, " ", words);
00265 
00266   if (name.find ("_triggers") != cmt_string::npos)
00267     {
00268       name.replace ("_triggers", "");
00269 
00270       Libmap& libmap = Libmap::add (name, package);
00271 
00272       for (int i = 0; i < words.size (); i++)
00273         {
00274           const cmt_string& w = words[i];
00275           libmap.add_trigger (w);
00276         }
00277     }
00278   else if (name.find ("_implied_libraries") != cmt_string::npos)
00279     {
00280       name.replace ("_implied_libraries", "");
00281 
00282       Libmap& libmap = Libmap::add (name, package);
00283 
00284       for (int i = 0; i < words.size (); i++)
00285         {
00286           const cmt_string& w = words[i];
00287           libmap.add_use (w);
00288         }
00289     }
00290   else
00291     {
00292       if (!Cmt::get_quiet ())
00293         {
00294           cerr << "Syntax error in trigger file : bad keyword (" << 
00295               name << ")" << endl;
00296         }
00297       exit (0);
00298     }
00299 }


Member Data Documentation

cmt_string TriggerAnalyzer::package [private]
 

Definition at line 224 of file cmt_triggers.cxx.


The documentation for this class was generated from the following file:
Generated at Thu May 16 16:28:01 2002 for CMT by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000