proj home

Files   Classes   Functions   Hierarchy  

vrmlshapetokengroup Class Reference

A collection of tokens. More...

#include <vrmlshapeparse.h>

Collaboration diagram for vrmlshapetokengroup:

List of all members.

Public Member Functions

void eval (vrmlshapeparse &p) const
 Iterate over a group of tokens and eval(vrmlshapeparse&) on the token if a match occures.
 ~vrmlshapetokengroup ()
 Clean up pointers allocated by client.

Public Attributes

vector< vrmlshapetoken * > tokens
 Client inserts tokens with new operator.


Detailed Description

A collection of tokens.

The parser looks for the current token within the tokens vector. The first match is done. So for all unique tokens the order of the tokens vector does not matter.

Definition at line 85 of file vrmlshapeparse.h.


Constructor & Destructor Documentation

vrmlshapetokengroup::~vrmlshapetokengroup (  ) 

Clean up pointers allocated by client.

Definition at line 131 of file vrmlshapeparse.cpp.

References tokens.

00132 {
00133   if( tokens.empty()==false)
00134   {
00135     for (uint i=0; i<tokens.size(); ++i)
00136     {
00137       delete tokens[i];
00138       tokens[i]=0;
00139     }
00140   }
00141 }


Member Function Documentation

void vrmlshapetokengroup::eval ( vrmlshapeparse p  )  const

Iterate over a group of tokens and eval(vrmlshapeparse&) on the token if a match occures.

Definition at line 97 of file vrmlshapeparse.cpp.

References tokens, and vrmlshapeparse::tokenstream.

Referenced by vrmlshapeMaterial::depth(), vrmlshapeIndexedFaceSet::depth(), vrmlshapeIndexedLineSet::depth(), and vrmlshapeShape::depth().

00098 {
00099   uint kmax = tokens.size();
00100   uint k=0;
00101   bool res(false);
00102   for ( ; k<kmax; ++k)
00103   {
00104 
00105     tokens[k]->eval(res,p);
00106     if (res)
00107       return;
00108   }
00109 
00110   if (res==false)
00111     ++p.tokenstream;
00112 
00113 /*
00114 
00115   vector< vrmlshapetoken* >::const_iterator k = tokens.begin();
00116   vector< vrmlshapetoken* >::const_iterator kend = tokens.end();
00117 
00118   bool res = false;
00119 // cout << "> " << p.tokenstream() << endl;
00120   while ((k!=kend) && (res==false))
00121   {
00122     (*k)->eval(res,p);
00123     ++k;
00124   }
00125   // If the token was not consumed/processed, consume it.
00126   if (res==false)
00127     ++p.tokenstream;
00128 */
00129 }


Member Data Documentation


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:50:25 2011 for Chelton Evans Source by  doxygen 1.5.8