Update of /cvsroot/cpptool/rfta/src/rftaparser
In directory sc8-pr-cvs1:/tmp/cvs-serv1395/src/rftaparser
Modified Files:
DeclarationDetailsParser.cpp DeclarationDetailsParser.h
Log Message:
* fixed enum body parsing bug (was looking for a ';' during parsing). Now using a specific parser: EnumBodyParser
Index: DeclarationDetailsParser.cpp
===================================================================
RCS file: /cvsroot/cpptool/rfta/src/rftaparser/DeclarationDetailsParser.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DeclarationDetailsParser.cpp 1 May 2003 21:54:40 -0000 1.4
--- DeclarationDetailsParser.cpp 3 May 2003 17:41:38 -0000 1.5
***************
*** 10,13 ****
--- 10,14 ----
#include <rfta/parser/ParseContext.h>
#include <rfta/parser/DeclarationListParser.h>
+ #include "EnumBodyParser.h"
***************
*** 403,420 ****
}
void
DeclarationDetailsParser::readClassOrEnumSpecifier( const ASTNodePtr& specifier,
std::string keyword )
{
- ASTNodePtr body;
-
if ( keyword == "class" || keyword == "struct" || keyword == "union" )
! body = readClassSpecifierBodySkippingInheritance( specifier );
! else
! body = readEnumSpecifierBody( specifier );
! findNextBalanced('{','}');
! body->setEndIndex( getCurrentIndex() ); // do not count the last '}'
}
--- 404,424 ----
}
+
void
DeclarationDetailsParser::readClassOrEnumSpecifier( const ASTNodePtr& specifier,
std::string keyword )
{
if ( keyword == "class" || keyword == "struct" || keyword == "union" )
! {
! ASTNodePtr body = readClassSpecifierBodySkippingInheritance( specifier );
! findNextBalanced('{','}');
! body->setEndIndex( getCurrentIndex() ); // do not count the last '}'
! }
! else
! {
! readEnumSpecifierBody( specifier );
! }
}
***************
*** 435,442 ****
! ASTNodePtr
DeclarationDetailsParser::readEnumSpecifierBody( const ASTNodePtr& specifier )
{
specifier->mutateType( ASTNodeTypes::enumSpecifier );
expect('{');
--- 439,450 ----
! void
DeclarationDetailsParser::readEnumSpecifierBody( const ASTNodePtr& specifier )
{
specifier->mutateType( ASTNodeTypes::enumSpecifier );
+ context_.bindNextNodeToProperty( specifier, ASTNodeProperties::enumBodyProperty );
+ EnumBodyParser bodyParser( context_, current_, end_ );
+ subParse( bodyParser );
+ /*
expect('{');
***************
*** 447,450 ****
--- 455,459 ----
specifier->setPropertyNode( ASTNodeProperties::enumBodyProperty , body );
return body;
+ */
}
Index: DeclarationDetailsParser.h
===================================================================
RCS file: /cvsroot/cpptool/rfta/src/rftaparser/DeclarationDetailsParser.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DeclarationDetailsParser.h 1 May 2003 20:54:10 -0000 1.2
--- DeclarationDetailsParser.h 3 May 2003 17:41:38 -0000 1.3
***************
*** 54,58 ****
std::string keyword );
ASTNodePtr readClassSpecifierBodySkippingInheritance( const ASTNodePtr &specifier );
! ASTNodePtr readEnumSpecifierBody( const ASTNodePtr &specifier );
//
--- 54,58 ----
std::string keyword );
ASTNodePtr readClassSpecifierBodySkippingInheritance( const ASTNodePtr &specifier );
! void readEnumSpecifierBody( const ASTNodePtr &specifier );
//
|