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

Constituent Class Reference

#include

Collaboration diagram for Constituent:

[legend]
List of all members.

Public Types

typedef cmt_vector< Constituent >? ConstituentVector

Public Methods

? Constituent ()
? ~Constituent ()
void? parse ()
virtual void? clear ()
virtual void? build_makefile (bool simulation) const
virtual void? build_msdev_file (bool simulation) const
virtual void? build_vsnet_file (bool simulation) const
virtual void? show () const

Static Public Methods

void? action (ConstituentType type, const CmtSystem::cmt_string_vector &words)
Constituent *? find (const cmt_string &name)
Constituent *? add (ConstituentType type, const cmt_string &name, const cmt_string &generator)
Constituent *? add_for_action (const cmt_string &name)
void? show (const cmt_string &name)
void? parse_all ()
void? show_all ()
void? show_names ()
void? build_all_makefiles (bool simulation)
void? build_all_msdev_files (bool simulation)
void? build_all_vsnet_files (bool simulation)
void? clear_all ()
ConstituentVector &? constituents ()

Public Attributes

cmt_string? name
cmt_string? generator
ConstituentType? type
Group *? group
cmt_string? suffix
CmtSystem::cmt_string_vector? modules
bool? need_OS9
bool? windows
bool? no_static
bool? no_share
bool? need_prototypes
bool? need_check
bool? build_triggers
bool? has_target_tag
CmtSystem::cmt_string_vector? excludes
cmt_vector< cmt_regexp >? exclude_exprs
CmtSystem::cmt_string_vector? selects
cmt_vector< cmt_regexp >? select_exprs
CmtSystem::cmt_string_vector? includes
CmtSystem::cmt_string_vector? imports
Variable::VariableVector? variables

Private Attributes

CmtSystem::cmt_string_vector? parameters

Member Typedef Documentation

typedef cmt_vector Constituent::ConstituentVector
?

Definition at line 18 of file cmt_constituent.h.


Constructor & Destructor Documentation

Constituent::Constituent (? ? )?
?

Definition at line 437 of file cmt_constituent.cxx.

References clear().

00438 {
00439   clear ();
00440 }

Constituent::~Constituent (? ? )?
?

Definition at line 443 of file cmt_constituent.cxx.

00444 {
00445 }

Member Function Documentation

void Constituent::action (? ConstituentType? ? type,
const CmtSystem::cmt_string_vector &? ? words
)? [static]
?

Definition at line 304 of file cmt_constituent.cxx.

References cmt_vector< cmt_string >::add(), add(), ConstituentType, Document, generator, name, parameters, cmt_vector< cmt_string >::size(), and type.

Referenced by KwdLibrary::action(), KwdDocument::action(), and KwdApplication::action().

00306 {
00307   cmt_string generator;
00308   cmt_string name;
00309   Constituent* constituent;
00310 
00311   int i = 1;
00312 
00313   if (type == Document)
00314     {
00315       generator = words[i];
00316       if (generator == "") return;
00317       i++;
00318     }
00319 
00320   name = words[i];
00321   if (name == "") return;
00322   i++;
00323 
00324   constituent = add (type, name, generator);
00325 
00326   for (;i < words.size (); i++)
00327     {
00328       const cmt_string& w = words[i];
00329       cmt_string& parameter = constituent->parameters.add ();
00330       parameter = w;
00331     }
00332 }

Constituent * Constituent::add (? ConstituentType? ? type,
const cmt_string &? ? name,
const cmt_string &? ? generator
)? [static]
?

Definition at line 369 of file cmt_constituent.cxx.

References cmt_vector< Constituent >::add(), clear(), constituents(), ConstituentType, find(), generator, name, Cmt::need_prototypes(), need_prototypes, and type.

Referenced by action(), and add_for_action().

00372 {
00373   static ConstituentVector& Constituents = constituents ();
00374 
00375   {
00376     Constituent* constituent;
00377 
00378     if (name == "") return (0);
00379 
00380     constituent = find (name);
00381     if (constituent != 0) return (constituent);
00382   }
00383 
00384   Constituent& constituent = Constituents.add ();
00385   constituent.clear ();
00386 
00387   constituent.name      = name;
00388   constituent.generator = generator;
00389   constituent.type      = type;
00390   constituent.need_prototypes = Cmt::need_prototypes ();
00391 
00392   return (&constituent);
00393 }

Constituent * Constituent::add_for_action (? const cmt_string &? ? name )? [static]
?

Definition at line 396 of file cmt_constituent.cxx.

References cmt_vector< cmt_string >::add(), Group::add(), add(), Document, group, has_target_tag, and parameters.

Referenced by parse_all().

00397 {
00398   Constituent* constituent;
00399 
00400   constituent = add (Document, name, "cmt_action_runner");
00401 
00402   constituent->group = Group::add ("cmt_actions");
00403   constituent->has_target_tag = true;
00404 
00405   cmt_string& p1 = constituent->parameters.add ();
00406   p1 = "action_value=";
00407   p1 += "'$(";
00408   p1 += name;
00409   p1 += ")'";
00410 
00411   return (constituent);
00412 }

void Constituent::build_all_makefiles (? bool? ? simulation )? [static]
?

Definition at line 474 of file cmt_constituent.cxx.

References build_makefile(), constituents(), and cmt_vector< Constituent >::size().

Referenced by Cmt::build_makefile().

00475 {
00476   static ConstituentVector& Constituents = constituents ();
00477 
00478   int i;
00479 
00480   for (i = 0; i < Constituents.size (); i++)
00481     {
00482       Constituent& constituent = Constituents[i];
00483 
00484       constituent.build_makefile (simulation);
00485     }
00486 }

void Constituent::build_all_msdev_files (? bool? ? simulation )? [static]
?

Definition at line 489 of file cmt_constituent.cxx.

References build_msdev_file(), Generator::build_msdev_workspace(), constituents(), and cmt_vector< Constituent >::size().

Referenced by Cmt::build_msdev_file().

00490 {
00491   static ConstituentVector& Constituents = constituents ();
00492 
00493   int i;
00494 
00495   Generator::build_msdev_workspace (Constituents);
00496 
00497   for (i = 0; i < Constituents.size (); i++)
00498     {
00499       Constituent& constituent = Constituents[i];
00500 
00501       constituent.build_msdev_file (simulation);
00502     }
00503 }

void Constituent::build_all_vsnet_files (? bool? ? simulation )? [static]
?

Definition at line 507 of file cmt_constituent.cxx.

References build_vsnet_file(), Generator::build_vsnet_workspace(), constituents(), and cmt_vector< Constituent >::size().

Referenced by Cmt::build_vsnet_file().

00508 {                                                                
00509   static ConstituentVector& Constituents = constituents ();      
00510                                                                  
00511   int i;                                                         
00512                                                                  
00513   Generator::build_vsnet_workspace (Constituents);               
00514                                                                  
00515   for (i = 0; i < Constituents.size (); i++)                     
00516     {                                                            
00517       Constituent& constituent = Constituents[i];                
00518                                                                  
00519       constituent.build_vsnet_file (simulation);                 
00520     }                                                            
00521 }                                                                

void Constituent::build_makefile (? bool? ? simulation )? const [virtual]
?

Definition at line 524 of file cmt_constituent.cxx.

References Generator::build_constituent_makefile().

Referenced by build_all_makefiles(), and Cmt::build_makefile().

00525 {
00526   if (!simulation)
00527     {
00528       Generator::build_constituent_makefile (*this);
00529     }
00530 }

void Constituent::build_msdev_file (? bool? ? simulation )? const [virtual]
?

Definition at line 533 of file cmt_constituent.cxx.

References Generator::build_msdev().

Referenced by build_all_msdev_files(), and Cmt::build_msdev_file().

00534 {
00535   if (!simulation)
00536     {
00537       Generator::build_msdev (*this);
00538     }
00539 }

void Constituent::build_vsnet_file (? bool? ? simulation )? const [virtual]
?

Definition at line 543 of file cmt_constituent.cxx.

References Generator::build_vsnet().

Referenced by build_all_vsnet_files(), and Cmt::build_vsnet_file().

00544 {                                                             
00545   if (!simulation)                                            
00546     {                                                         
00547       Generator::build_vsnet (*this);                         
00548     }
00549 }

void Constituent::clear (? ? )? [virtual]
?

Definition at line 448 of file cmt_constituent.cxx.

References build_triggers, cmt_vector< Variable >::clear(), cmt_vector< cmt_regexp >::clear(), cmt_vector< cmt_string >::clear(), Document, exclude_exprs, excludes, generator, group, has_target_tag, imports, includes, modules, name, need_check, need_OS9, need_prototypes, no_share, no_static, parameters, select_exprs, selects, type, variables, and windows.

Referenced by add(), clear_all(), and Constituent().

00449 {
00450   name      = "";
00451   generator = "";
00452   type = Document;
00453   group     = 0;
00454   modules.clear ();
00455   parameters.clear ();
00456   need_OS9        = false;
00457   windows         = false;
00458   no_static       = false;
00459   no_share        = false;
00460   need_prototypes = false;
00461   need_check      = false;
00462   build_triggers  = false;
00463   has_target_tag  = false;
00464   excludes.clear ();
00465   exclude_exprs.clear ();
00466   selects.clear ();
00467   select_exprs.clear ();
00468   includes.clear ();
00469   imports.clear ();
00470   variables.clear ();
00471 }

void Constituent::clear_all (? ? )? [static]
?

Definition at line 415 of file cmt_constituent.cxx.

References cmt_vector< Constituent >::clear(), clear(), constituents(), and cmt_vector< Constituent >::size().

Referenced by Database::clear().

00416 {
00417   static ConstituentVector& Constituents = constituents ();
00418 
00419   for (int i = 0; i < Constituents.size (); i++)
00420     {
00421       Constituent& c = Constituents[i];
00422       c.clear ();
00423     }
00424   Constituents.clear ();
00425 }

Constituent::ConstituentVector & Constituent::constituents (? ? )? [static]
?

Definition at line 428 of file cmt_constituent.cxx.

References Database::constituents(), and Database::instance().

Referenced by add(), ConstituentsMakefileGenerator::build(), MakeSetupGenerator::build(), build_all_makefiles(), build_all_msdev_files(), build_all_vsnet_files(), clear_all(), StandardMacroBuilder::fill_for_all_constituents(), find(), parse_all(), Cmt::set_standard_macros(), show_all(), and show_names().

00429 {
00430   static Database& db = Database::instance ();
00431   static ConstituentVector& Constituents = db.constituents ();
00432 
00433   return (Constituents);
00434 }

Constituent * Constituent::find (? const cmt_string &? ? name )? [static]
?

Definition at line 95 of file cmt_constituent.cxx.

References constituents(), name, and cmt_vector< Constituent >::size().

Referenced by add(), DependencyGenerator::build(), Generator::build_constituent_makefile(), Cmt::build_makefile(), Cmt::build_msdev_file(), Cmt::build_vsnet_file(), Cmt::do_show_constituent(), TriggerGenerator::run(), and show().

00096 {
00097   static ConstituentVector& Constituents = constituents ();
00098 
00099   int constituent_index;
00100 
00101   if (Constituents.size () == 0) return (0);
00102 
00103   for (constituent_index = 0;
00104        constituent_index < Constituents.size ();
00105        constituent_index++)
00106     {
00107       Constituent& constituent = Constituents[constituent_index];
00108 
00109       if (constituent.name == name)
00110         {
00111           return (&constituent);
00112         }
00113     }
00114 
00115   return (0);
00116 }

void Constituent::parse (? ? )?
?

Definition at line 335 of file cmt_constituent.cxx.

References cmt_vector< cmt_string >::clear(), Symbol::expand(), modules, parameters, constituents_action_iterator::set(), cmt_vector< cmt_string >::size(), and CmtSystem::split().

Referenced by parse_all().

00336 {
00337   if (parameters.size () == 0) return;
00338 
00339   Constituent& me = *this;
00340 
00341   modules.clear ();
00342 
00343   constituents_action_iterator it (me);
00344 
00345   for (int i = 0; i < parameters.size (); i++)
00346     {
00347       const cmt_string& w = parameters[i];
00348       cmt_string ew = w;
00349 
00350       Symbol::expand (ew);
00351 
00352       CmtSystem::cmt_string_vector ws;
00353 
00354       CmtSystem::split (ew, " \t", ws);
00355 
00356       for (int j = 0; j < ws.size (); ++j)
00357         {
00358           const cmt_string& w = ws[j];
00359           
00360             //cerr << "Constituent " << name << " Setting module " << w << endl;
00361           it.set (w);
00362         }
00363     }
00364 
00365   parameters.clear ();
00366 }

void Constituent::parse_all (? ? )? [static]
?

Definition at line 35 of file cmt_constituent.cxx.

References add_for_action(), Symbol::build_macro_value(), constituents(), Symbol::name, parse(), cmt_vector< Constituent >::size(), cmt_vector< SymbolValueList >::size(), Symbol::symbol(), Symbol::symbol_number(), Symbol::SymbolAction, Symbol::type, and Symbol::value_lists.

Referenced by StandardMacroBuilder::fill_for_all_constituents().

00036 {
00037   static ConstituentVector& Constituents = constituents ();
00038 
00039   int number;
00040 
00041   for (number = 0; number < Symbol::symbol_number (); number++)
00042     {
00043       Symbol& symbol = Symbol::symbol (number);
00044 
00045       if (symbol.type != Symbol::SymbolAction) continue;
00046 
00047       if (symbol.value_lists.size () < 1) continue;
00048 
00049       cmt_string value = symbol.build_macro_value ();
00050 
00051       if (value != "")
00052         {
00053           add_for_action (symbol.name);
00054         }
00055     }
00056 
00057   for (number = 0; number < Constituents.size (); number++)
00058     {
00059       Constituent& constituent = Constituents[number];
00060 
00061       constituent.parse ();
00062     }
00063 }

void Constituent::show (? ? )? [virtual]
?

Definition at line 552 of file cmt_constituent.cxx.

References Application, build_triggers, Document, excludes, generator, group, imports, Library, modules, Variable::name, Group::name(), name, need_check, no_share, no_static, selects, cmt_vector< Variable >::size(), cmt_vector< cmt_string >::size(), suffix, type, Variable::value, and variables.

00553 {
00554   int i;
00555 
00556   switch (type)
00557     {
00558       case Library:
00559         cout << "library";
00560         break;
00561       case Application:
00562         cout << "application";
00563         break;
00564       case Document:
00565         cout << "document " << generator;
00566         break;
00567     }
00568   
00569   cout << " " << name;
00570   
00571   if (group != 0)
00572     {
00573       cout << " -group=" << group->name ();
00574     }
00575   
00576   if (suffix != 0)
00577     {
00578       cout << " -suffix=" << suffix;
00579     }
00580   
00581   if ((type == Application) && need_check)
00582     {
00583       cout << " -check";
00584     }
00585   
00586   if ((type == Library) && no_share)
00587     {
00588       cout << " -no_share";
00589     }
00590   
00591   if ((type == Library) && no_static)
00592     {
00593       cout << " -no_static";
00594     }
00595   
00596   if ((type == Library) && build_triggers)
00597     {
00598       cout << " -triggers";
00599     }
00600   
00601   if (has_target_tag)
00602     {
00603       cout << " -target_tag";
00604     }
00605   
00606   for (i = 0; i < (imports.size ()); i++)
00607     {
00608       const cmt_string& import_name = imports[i];
00609       
00610       cout << " -import=" << import_name;
00611     }
00612   
00613   for (i = 0; i < (excludes.size ()); i++)
00614     {
00615       const cmt_string& exclude = excludes[i];
00616       
00617       cout << " -x=" << exclude;
00618     }
00619   
00620   for (i = 0; i < (selects.size ()); i++)
00621     {
00622       const cmt_string& select = selects[i];
00623       
00624       cout << " -k=" << select;
00625     }
00626   
00627   for (i = 0; i < (modules.size ()); i++)
00628     {
00629       const cmt_string& module_name = modules[i];
00630       
00631       cout << " " << module_name;
00632     }
00633   
00634   for (i = 0; i < (variables.size ()); i++)
00635     {
00636       const Variable& v = variables[i];
00637       
00638       cout << " " << v.name << "=" << v.value;
00639     }
00640   
00641   cout << endl;
00642 }

void Constituent::show (? const cmt_string &? ? name )? [static]
?

Definition at line 24 of file cmt_constituent.cxx.

References find().

Referenced by Cmt::do_show_constituent(), and show_all().

00025 {
00026   Constituent* cptr = find (name);
00027   if (cptr == 0) return;
00028 
00029   const Constituent& constituent = *cptr;
00030 
00031   constituent.show ();
00032 }

void Constituent::show_all (? ? )? [static]
?

Definition at line 66 of file cmt_constituent.cxx.

References constituents(), show(), and cmt_vector< Constituent >::size().

Referenced by Cmt::do_show_constituents().

00067 {
00068   static ConstituentVector& Constituents = constituents ();
00069 
00070   int number;
00071 
00072   for (number = 0; number < Constituents.size (); number++)
00073     {
00074       const Constituent& constituent = Constituents[number];
00075 
00076       constituent.show ();
00077     }
00078 }

void Constituent::show_names (? ? )? [static]
?

Definition at line 81 of file cmt_constituent.cxx.

References constituents(), name, and cmt_vector< Constituent >::size().

Referenced by Cmt::do_show_constituent_names().

00082 {
00083   static ConstituentVector& Constituents = constituents ();
00084 
00085   int number;
00086 
00087   for (number = 0; number < Constituents.size (); number++)
00088     {
00089       Constituent& constituent = Constituents[number];
00090       cout << constituent.name << endl;
00091     }
00092 }

Member Data Documentation

bool Constituent::build_triggers
?

Definition at line 59 of file cmt_constituent.h.

Referenced by LibraryGenerator::build(), clear(), constituents_action_iterator::set(), and show().

cmt_vector Constituent::exclude_exprs
?

Definition at line 62 of file cmt_constituent.h.

Referenced by DependencyGenerator::build(), DocumentGenerator::build(), LibraryGenerator::build(), VSNETGenerator::build_project(), MSDEVGenerator::build_project(), clear(), and constituents_action_iterator::set().

CmtSystem::cmt_string_vector Constituent::excludes
?

Definition at line 61 of file cmt_constituent.h.

Referenced by clear(), constituents_action_iterator::set(), and show().

cmt_string Constituent::generator
?

Definition at line 48 of file cmt_constituent.h.

Referenced by action(), add(), DocumentGenerator::build(), VSNETGenerator::build_project(), MSDEVGenerator::build_project(), clear(), and show().

Group* Constituent::group
?

Definition at line 50 of file cmt_constituent.h.

Referenced by add_for_action(), clear(), constituents_action_iterator::set(), Cmt::set_standard_macros(), and show().

bool Constituent::has_target_tag
?

Definition at line 60 of file cmt_constituent.h.

Referenced by add_for_action(), ConstituentsMakefileGenerator::build(), DocumentGenerator::build(), LibraryGenerator::build(), clear(), and constituents_action_iterator::set().

CmtSystem::cmt_string_vector Constituent::imports
?

Definition at line 68 of file cmt_constituent.h.

Referenced by clear(), StandardMacroBuilder::fill_for_all_constituents(), constituents_action_iterator::set(), and show().

CmtSystem::cmt_string_vector Constituent::includes
?

Definition at line 67 of file cmt_constituent.h.

Referenced by DocumentGenerator::build(), LibraryGenerator::build(), VSNETGenerator::build_project(), MSDEVGenerator::build_project(), clear(), and constituents_action_iterator::set().

CmtSystem::cmt_string_vector Constituent::modules
?

Definition at line 52 of file cmt_constituent.h.

Referenced by DependencyGenerator::build(), DocumentGenerator::build(), LibraryGenerator::build(), VSNETGenerator::build_project(), MSDEVGenerator::build_project(), clear(), parse(), constituents_action_iterator::set(), and show().

cmt_string Constituent::name
?

Definition at line 47 of file cmt_constituent.h.

Referenced by action(), add(), LibraryGenerator::analyze_file(), ConstituentsMakefileGenerator::build(), DocumentGenerator::build(), VSNETGenerator::build_project(), MSDEVGenerator::build_project(), VSNETGenerator::build_workspace(), MSDEVGenerator::build_workspace(), clear(), ApplicationAnalyzer::end(), LibraryAnalyzer::end(), StandardMacroBuilder::fill_for_all_constituents(), find(), CmtGenerator::prepare_output(), constituents_action_iterator::set(), Cmt::set_standard_macros(), show(), and show_names().

bool Constituent::need_check
?

Definition at line 58 of file cmt_constituent.h.

Referenced by ConstituentsMakefileGenerator::build(), LibraryGenerator::build(), clear(), constituents_action_iterator::set(), and show().

bool Constituent::need_OS9
?

Definition at line 53 of file cmt_constituent.h.

Referenced by VSNETGenerator::build_project(), MSDEVGenerator::build_project(), clear(), CmtGenerator::prepare_output(), and constituents_action_iterator::set().

bool Constituent::need_prototypes
?

Definition at line 57 of file cmt_constituent.h.

Referenced by add(), LibraryGenerator::build(), clear(), and constituents_action_iterator::set().

bool Constituent::no_share
?

Definition at line 56 of file cmt_constituent.h.

Referenced by LibraryGenerator::build(), VSNETGenerator::build_project(), MSDEVGenerator::build_project(), clear(), constituents_action_iterator::set(), and show().

bool Constituent::no_static
?

Definition at line 55 of file cmt_constituent.h.

Referenced by clear(), constituents_action_iterator::set(), and show().

CmtSystem::cmt_string_vector Constituent::parameters [private]
?

Definition at line 72 of file cmt_constituent.h.

Referenced by action(), add_for_action(), clear(), and parse().

cmt_vector Constituent::select_exprs
?

Definition at line 65 of file cmt_constituent.h.

Referenced by DependencyGenerator::build(), DocumentGenerator::build(), LibraryGenerator::build(), VSNETGenerator::build_project(), MSDEVGenerator::build_project(), clear(), and constituents_action_iterator::set().

CmtSystem::cmt_string_vector Constituent::selects
?

Definition at line 64 of file cmt_constituent.h.

Referenced by clear(), constituents_action_iterator::set(), and show().

cmt_string Constituent::suffix
?

Definition at line 51 of file cmt_constituent.h.

Referenced by LibraryGenerator::analyze_file(), ConstituentsMakefileGenerator::build(), MSDEVGenerator::build_project(), VSNETGenerator::build_workspace(), MSDEVGenerator::build_workspace(), CmtGenerator::prepare_output(), constituents_action_iterator::set(), and show().

ConstituentType Constituent::type
?

Definition at line 49 of file cmt_constituent.h.

Referenced by action(), add(), LibraryGenerator::build(), Generator::build_constituent_makefile(), VSNETGenerator::build_project(), MSDEVGenerator::build_project(), VSNETGenerator::build_workspace(), MSDEVGenerator::build_workspace(), clear(), StandardMacroBuilder::fill_for_all_constituents(), TriggerGenerator::run(), constituents_action_iterator::set(), and show().

Variable::VariableVector Constituent::variables
?

Definition at line 69 of file cmt_constituent.h.

Referenced by ConstituentsMakefileGenerator::build(), DocumentGenerator::build(), LibraryGenerator::build(), VSNETGenerator::build_project(), MSDEVGenerator::build_project(), VSNETGenerator::build_workspace(), MSDEVGenerator::build_workspace(), clear(), LibraryGenerator::java_file_action(), LibraryGenerator::module_file_action(), LibraryGenerator::proto_file_action(), constituents_action_iterator::set(), and show().

bool Constituent::windows
?

Definition at line 54 of file cmt_constituent.h.

Referenced by VSNETGenerator::build_project(), MSDEVGenerator::build_project(), clear(), and constituents_action_iterator::set().


The documentation for this class was generated from the following files:
Generated on Wed Sep 1 11:00:13 2004 for CMT by 1.2.18