Update of /cvsroot/cpptool/CppParser/examples/parser
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15519/examples/parser
Modified Files:
symboltabletest.cpp
Log Message:
* added a description section to test file
Index: symboltabletest.cpp
===================================================================
RCS file: /cvsroot/cpptool/CppParser/examples/parser/symboltabletest.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** symboltabletest.cpp 14 Jun 2004 23:08:11 -0000 1.2
--- symboltabletest.cpp 20 Jun 2004 08:25:24 -0000 1.3
***************
*** 234,239 ****
std::string declarations_;
unsigned declarationsStartLine_;
- bool isReadingDeclarations_;
NodePtr declarationsTree_;
TestProject &project_;
--- 234,240 ----
std::string declarations_;
+ std::string description_;
+ std::string *currentLineBuffer_;
unsigned declarationsStartLine_;
NodePtr declarationsTree_;
TestProject &project_;
***************
*** 244,249 ****
: LineProcessor( tracker )
, project_( project )
- , isReadingDeclarations_( false )
, declarationsStartLine_( -1 )
{
}
--- 245,250 ----
: LineProcessor( tracker )
, project_( project )
, declarationsStartLine_( -1 )
+ , currentLineBuffer_( 0 )
{
}
***************
*** 260,264 ****
SymbolTableTestProcessor::commentAllowed() const
{
! return !isReadingDeclarations_;
}
--- 261,265 ----
SymbolTableTestProcessor::commentAllowed() const
{
! return !currentLineBuffer_;
}
***************
*** 266,274 ****
SymbolTableTestProcessor::doProcessLine( const std::string &line )
{
! if ( !isReadingDeclarations_ )
return;
! declarations_ += line;
! declarations_ += "\n";
}
--- 267,275 ----
SymbolTableTestProcessor::doProcessLine( const std::string &line )
{
! if ( !currentLineBuffer_ )
return;
! *currentLineBuffer_ += line;
! *currentLineBuffer_ += "\n";
}
***************
*** 279,287 ****
if ( name == "declarations" )
{
! isReadingDeclarations_ = true;
declarations_ = "";
declarationsStartLine_ = currentLine() + 1;
return true;
}
return false;
}
--- 280,293 ----
if ( name == "declarations" )
{
! currentLineBuffer_ = &declarations_;
declarations_ = "";
declarationsStartLine_ = currentLine() + 1;
return true;
}
+ else if ( name == "description" )
+ {
+ currentLineBuffer_ = &description_;
+ return true;
+ }
return false;
}
***************
*** 299,307 ****
SymbolTableTestProcessor::doTerminateCurrentAction()
{
! if ( isReadingDeclarations_ )
! {
! isReadingDeclarations_ = false;
processDeclarations();
! }
}
--- 305,311 ----
SymbolTableTestProcessor::doTerminateCurrentAction()
{
! if ( currentLineBuffer_ == &declarations_ )
processDeclarations();
! currentLineBuffer_ = 0;
}
|