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

UseScanner Class Reference

#include <Package.h>

Inheritance diagram for UseScanner

[legend]
Collaboration diagram for UseScanner:

[legend]
List of all members.

Public Methods

? UseScanner (const Package& t, Package& s, tree_node& node)
? It will check whether the package s uses the package t by scanning its requirements file against use statements to the package t. More...

void? begin ()
void? filter (const cmt_string& line)
? The UseScanner is supposed to be started with a filtering regular expression of the form [^use ...] Therefore we really consider that the lines here really conform to this pattern. More...

void? end ()
? We are now going to recurse, by getting all clients of "scanned". More...


Private Attributes

const Package&? tested
Package&? scanned
tree_node&? parent_node
bool? done

Constructor & Destructor Documentation

UseScanner::UseScanner ( const Package & t,
Package & s,
tree_node & node?)
?

It will check whether the package s uses the package t by scanning its requirements file against use statements to the package t.

Definition at line 340 of file Package.cxx.

00342                                          : 
00343   tested (t),
00344   scanned (s),
00345   parent_node (node)
00346 {
00347 }

Member Function Documentation

void UseScanner::begin ( )
?

Definition at line 349 of file Package.cxx.

00350 {
00351   done = false;
00352 }

void UseScanner::end ( )
?

We are now going to recurse, by getting all clients of "scanned".

Definition at line 409 of file Package.cxx.

00410 {
00411 }

void UseScanner::filter ( const cmt_string & line?)
?

The UseScanner is supposed to be started with a filtering regular expression of the form [^use ...] Therefore we really consider that the lines here really conform to this pattern.

Definition at line 359 of file Package.cxx.

00360 {
00361   //cout << "  filtering [" << line << "]" << endl; 
00362   if (done) return;
00363 
00364   static int level = 0;
00365 
00366   CmtSystem::cmt_string_vector words;
00367   CmtSystem::split (line, " ", words);
00368 
00369   cmt_string p;
00370   cmt_string v;
00371   cmt_string pp;
00372 
00373   if (words.size () > 1) p = words[1];
00374   if (words.size () > 2) v = words[2];
00375   if (words.size () > 3) pp = words[3];
00376 
00377   Package& package = Package::create (p, v, pp);
00378   if (package == tested)
00379     {
00380       // here "scanned" is really using tested
00381 
00382       for (int j = 0; j < level; j++) cout << "  ";
00383       //cout << "  yes " << scanned.get_name () << " uses " << tested.get_name () << endl;
00384       cout << "  " << scanned.get_name () << endl;
00385 
00386       tree_node& node = parent_node.append (scanned);
00387 
00392       if (scanned.is_done ()) return;
00393       scanned.set_done ();
00394 
00395       done = true;
00396 
00397       level++;
00398 
00403       scanned.collect_clients (node);
00404 
00405       level--;
00406     }
00407 }

Member Data Documentation

bool UseScanner::done [private]
?

Definition at line 26 of file Package.h.

tree_node & UseScanner::parent_node [private]
?

Definition at line 25 of file Package.h.

Package & UseScanner::scanned [private]
?

Definition at line 24 of file Package.h.

const Package & UseScanner::tested [private]
?

Definition at line 23 of file Package.h.


The documentation for this class was generated from the following files:
Generated at Fri Apr 12 16:18:17 2002 for cmtgrapher by 1.2.3 written by , ??1997-2000