You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(15) |
Feb
(26) |
Mar
(97) |
Apr
(224) |
May
(226) |
Jun
|
Jul
(3) |
Aug
(22) |
Sep
(48) |
Oct
|
Nov
|
Dec
(38) |
2004 |
Jan
(28) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(37) |
Jul
|
Aug
(73) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <sve...@us...> - 2003-04-21 16:06:54
|
Update of /cvsroot/cpptool/rfta/src/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv17334/src/rfta Modified Files: CodeRewriter.cpp Log Message: added handling of initializers in declarators Index: CodeRewriter.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/CodeRewriter.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** CodeRewriter.cpp 21 Apr 2003 03:08:54 -0000 1.40 --- CodeRewriter.cpp 21 Apr 2003 16:06:50 -0000 1.41 *************** *** 674,677 **** --- 674,681 ---- "", currentInsertionPos_ ); + if ( ! declarator->hasInitializer() ) + return; + if ( isInserting() ) + insertText( declarator->getInitializer()->getSourceText() ); } |
From: <sve...@us...> - 2003-04-21 03:08:59
|
Update of /cvsroot/cpptool/rfta/include/rfta/refactoring In directory sc8-pr-cvs1:/tmp/cvs-serv8439/include/rfta/refactoring Modified Files: CodeModelVisitor.h CodeModel.h ChangeTrackers.h Log Message: improved code rewriting for declaration lists Index: CodeModelVisitor.h =================================================================== RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/CodeModelVisitor.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CodeModelVisitor.h 10 Apr 2003 08:37:49 -0000 1.7 --- CodeModelVisitor.h 21 Apr 2003 03:08:55 -0000 1.8 *************** *** 46,50 **** virtual void visit( const AssignInitializerExpressionPtr &expression ) =0; virtual void visit( const ConstructorInitializerExpressionPtr &expression ) =0; ! virtual void visit( const DeclaratorExpressionPtr &expression ) =0; virtual void visit( const DefaultConditionExpressionPtr &expression ) =0; virtual void visit( const ExpressionPtr &expression ) =0; --- 46,50 ---- virtual void visit( const AssignInitializerExpressionPtr &expression ) =0; virtual void visit( const ConstructorInitializerExpressionPtr &expression ) =0; ! virtual void visit( const DeclaratorExpression &expression ) =0; virtual void visit( const DefaultConditionExpressionPtr &expression ) =0; virtual void visit( const ExpressionPtr &expression ) =0; Index: CodeModel.h =================================================================== RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/CodeModel.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CodeModel.h 10 Apr 2003 08:37:46 -0000 1.5 --- CodeModel.h 21 Apr 2003 03:08:55 -0000 1.6 *************** *** 12,15 **** --- 12,19 ---- #include <stdexcept> + #ifndef _MSC_VER + # include <map> + #endif + namespace Refactoring { namespace CodeModel { Index: ChangeTrackers.h =================================================================== RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/ChangeTrackers.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ChangeTrackers.h 10 Apr 2003 08:37:46 -0000 1.1 --- ChangeTrackers.h 21 Apr 2003 03:08:55 -0000 1.2 *************** *** 278,282 **** return it - changes_.begin(); } ! throw std::out_of_range( "index out of range for CompositeChangeTracker::getActualIndex()" ); } --- 278,282 ---- return it - changes_.begin(); } ! assert(false); // throw std::out_of_range( "index out of range for CompositeChangeTracker::getActualIndex()" ); } *************** *** 302,304 **** ! #endif // RFTA_CHANGETRACKERS_H_INCLUDED \ No newline at end of file --- 302,304 ---- ! #endif // RFTA_CHANGETRACKERS_H_INCLUDED |
From: <sve...@us...> - 2003-04-21 03:08:58
|
Update of /cvsroot/cpptool/rfta/src/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv8439/src/rfta Modified Files: CodeWriterTest.h CodeWriterTest.cpp CodeRewriter.h CodeRewriter.cpp CodeModelGeneratorTest.h CodeModelGeneratorTest.cpp CodeModelExpressions.cpp CodeModelElement.cpp CodeModel.cpp Log Message: improved code rewriting for declaration lists Index: CodeWriterTest.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/CodeWriterTest.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** CodeWriterTest.h 10 Apr 2003 08:37:51 -0000 1.28 --- CodeWriterTest.h 21 Apr 2003 03:08:53 -0000 1.29 *************** *** 17,20 **** --- 17,21 ---- { CPPUNIT_TEST_SUITE( CodeWriterTest ); + CPPUNIT_TEST( testRewriteUnchanged ); CPPUNIT_TEST( testRewriteStatement ); CPPUNIT_TEST( testInsertReturnValueStatement ); *************** *** 41,44 **** --- 42,49 ---- CPPUNIT_TEST( testModifyForIteratedStatement ); CPPUNIT_TEST( testModifyDeclarationExpresion ); + CPPUNIT_TEST( testAddDeclaratorFront ); + CPPUNIT_TEST( testRemoveDeclaratorBeginning ); + CPPUNIT_TEST( testRemoveDeclaratorMiddle ); + CPPUNIT_TEST_FAIL( testRemoveDeclaratorEnd ); CPPUNIT_TEST_SUITE_END(); *************** *** 53,57 **** void setUp(); void tearDown(); ! void testRewriteStatement(); void testInsertReturnValueStatement(); --- 58,62 ---- void setUp(); void tearDown(); ! void testRewriteUnchanged(); void testRewriteStatement(); void testInsertReturnValueStatement(); *************** *** 87,90 **** --- 92,99 ---- void testModifyDeclarationExpresion(); + void testAddDeclaratorFront(); + void testRemoveDeclaratorBeginning(); + void testRemoveDeclaratorMiddle(); + void testRemoveDeclaratorEnd(); private: Index: CodeWriterTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/CodeWriterTest.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** CodeWriterTest.cpp 10 Apr 2003 08:37:51 -0000 1.34 --- CodeWriterTest.cpp 21 Apr 2003 03:08:53 -0000 1.35 *************** *** 37,40 **** --- 37,57 ---- } + void + CodeWriterTest::testRewriteUnchanged() + { + source_ = "{ double x, y; }"; + generateCompound(); + RFTA_ASSERT_EQUAL( 1, compound_->getStatementCount() ); + + CodeModel::DeclarationStatement& declarationStatement + = dynamic_cast<CodeModel::DeclarationStatement&> (*compound_->getStatementAt(0) ); + CodeModel::DeclaratorExpressionPtr declaratorExpression + = declarationStatement.getDeclaration(); + RFTA_ASSERT_EQUAL( 2, declaratorExpression->getDeclaratorCount()); + std::string expectedSource(source_); + rewriteSource(); + + RFTA_ASSERT_EQUAL( expectedSource, document_->getAllText() ); + } void *************** *** 539,542 **** --- 556,620 ---- + void + CodeWriterTest::testAddDeclaratorFront() + { + source_ = "{\n" + " int x;\n" + "}"; + generateCompound(); + CodeModel::DeclarationStatement &declarationStatement = + dynamic_cast<CodeModel::DeclarationStatement &>( *compound_->getStatementAt(0) ); + CodeModel::DeclaratorPtr declarator( new CodeModel::Declarator( makeTypePart(""), + makeIdentifier("y"), + makeTypePart("") ) ); + declarationStatement.getDeclaration()->insertDeclaratorAt(0, declarator ); + generateAndCheckSource( "{\n" + " int y, x;\n" + "}" ); + } + + void + CodeWriterTest::testRemoveDeclaratorBeginning() + { + source_ = "{\n" + " int x, y, z;\n" + "}"; + generateCompound(); + CodeModel::DeclarationStatement &declarationStatement = + dynamic_cast<CodeModel::DeclarationStatement &>( *compound_->getStatementAt(0) ); + declarationStatement.getDeclaration()->removeDeclaratorAt(0); + generateAndCheckSource( "{\n" + " int y, z;\n" + "}"); + } + void + CodeWriterTest::testRemoveDeclaratorMiddle() + { + source_ = "{\n" + " int x, y, z;\n" + "}"; + generateCompound(); + CodeModel::DeclarationStatement &declarationStatement = + dynamic_cast<CodeModel::DeclarationStatement &>( *compound_->getStatementAt(0) ); + declarationStatement.getDeclaration()->removeDeclaratorAt(1); + generateAndCheckSource( "{\n" + " int x, z;\n" + "}"); + } + void + CodeWriterTest::testRemoveDeclaratorEnd() + { + CPPUNIT_FAIL( "fails due to some problems with text transforms" ); + source_ = "{\n" + " int x, y, z;\n" + "}"; + generateCompound(); + CodeModel::DeclarationStatement &declarationStatement = + dynamic_cast<CodeModel::DeclarationStatement &>( *compound_->getStatementAt(0) ); + declarationStatement.getDeclaration()->removeDeclaratorAt(2); + generateAndCheckSource( "{\n" + " int x, y;\n" + "}"); + } } // namespace Refactoring Index: CodeRewriter.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/CodeRewriter.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** CodeRewriter.h 10 Apr 2003 08:37:50 -0000 1.17 --- CodeRewriter.h 21 Apr 2003 03:08:54 -0000 1.18 *************** *** 13,16 **** --- 13,20 ---- + #ifndef _MSC_VER + # include <string> + #endif + namespace Refactoring { *************** *** 55,59 **** void visit( const AssignInitializerExpressionPtr &expression ); void visit( const ConstructorInitializerExpressionPtr &expression ); ! void visit( const DeclaratorExpressionPtr &expression ); void visit( const DefaultConditionExpressionPtr &expression ); void visit( const ExpressionPtr &expression ); --- 59,63 ---- void visit( const AssignInitializerExpressionPtr &expression ); void visit( const ConstructorInitializerExpressionPtr &expression ); ! void visit( const DeclaratorExpression &expression ); void visit( const DefaultConditionExpressionPtr &expression ); void visit( const ExpressionPtr &expression ); *************** *** 165,169 **** void processDeclarator( const DeclaratorPtr &declarator ); ! private: IndentLevelManager indentManager_; --- 169,175 ---- void processDeclarator( const DeclaratorPtr &declarator ); ! void deleteTextIfNecessary(const Change& change); ! bool needsToInsertComma( const Change& change, int index, ! bool firstWasAdded); private: IndentLevelManager indentManager_; Index: CodeRewriter.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/CodeRewriter.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** CodeRewriter.cpp 10 Apr 2003 08:37:50 -0000 1.39 --- CodeRewriter.cpp 21 Apr 2003 03:08:54 -0000 1.40 *************** *** 293,304 **** { Change change = statement->getChangeAt( index ); ! ! if ( change.wasRemoved() || change.wasReplaced() ) ! { ! deleteText( change.oldRange_ ); ! ! if ( change.wasRemoved() ) ! continue; ! } currentInsertionPos_ = nextStatementInsertionPos; --- 293,299 ---- { Change change = statement->getChangeAt( index ); ! deleteTextIfNecessary( change ); ! if ( change.wasRemoved() ) ! continue; currentInsertionPos_ = nextStatementInsertionPos; *************** *** 637,660 **** void ! CodeRewriter::visit( const DeclaratorExpressionPtr &expression ) { if ( isInserting() ) beginInsertNewStatement(); ! handleMandatoryChange( expression->getPrimaryTypeChange(), ! *expression->getPrimaryType() ); ! ! for ( int index =0; index < expression->getChangeCount(); ++index ) { ! Change change = expression->getChangeAt( index ); ! DeclaratorPtr declarator = expression->getChangeDeclaratorAt( index ); ! ! if ( index > 0 ) ! insertText( ", " ); ! ModeModifier mode( mode_, change.isUnmodified() ? updating : inserting ); processDeclarator( declarator ); } - if ( isInserting() ) endInsertNewStatement(); --- 632,659 ---- void ! CodeRewriter::visit( const DeclaratorExpression &expression ) { if ( isInserting() ) beginInsertNewStatement(); ! handleMandatoryChange( expression.getPrimaryTypeChange(), ! *expression.getPrimaryType() ); ! bool firstWasAdded = false; ! for ( int index = 0; index < expression.getChangeCount(); ++ index ) { ! Change change = expression.getChangeAt( index ); ! deleteTextIfNecessary( change ); ! if (change.wasRemoved()) ! continue; ! if ( index == 0 ) ! firstWasAdded = change.wasAdded(); ! if ( needsToInsertComma( change, index, firstWasAdded ) ) ! insertText( ", " ); ! ! DeclaratorPtr declarator = expression.getChangeDeclaratorAt( index ); ! ModeModifier mode( mode_, change.isUnmodified() ? updating : inserting ); processDeclarator( declarator ); } if ( isInserting() ) endInsertNewStatement(); *************** *** 724,727 **** --- 723,741 ---- } + void + CodeRewriter::deleteTextIfNecessary( const Change& change ) + { + if ( change.wasRemoved() || change.wasReplaced() ) + { + replaceText( change.oldRange_, ""); + } + } + + bool + CodeRewriter::needsToInsertComma( const Change& change, int index, + bool firstWasAdded) + { + return (index > 0 && change.wasAdded()) || (index == 1 && firstWasAdded); + } } // namespace CodeModel Index: CodeModelGeneratorTest.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/CodeModelGeneratorTest.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CodeModelGeneratorTest.h 8 Mar 2003 13:10:44 -0000 1.1 --- CodeModelGeneratorTest.h 21 Apr 2003 03:08:54 -0000 1.2 *************** *** 19,22 **** --- 19,25 ---- CPPUNIT_TEST_SUITE( CodeModelGeneratorTest ); CPPUNIT_TEST( testGenerateDeclaratorExpression ); + CPPUNIT_TEST( testGenerateDeclaratorExpression2 ); + CPPUNIT_TEST( testGenerateDeclaratorExpression3 ); + //CPPUNIT_TEST( testFunctionPointer ); // does not parse CPPUNIT_TEST_SUITE_END(); *************** *** 33,36 **** --- 36,42 ---- void testGenerateDeclaratorExpression(); + void testGenerateDeclaratorExpression2(); + void testGenerateDeclaratorExpression3(); + void testFunctionPointer(); private: Index: CodeModelGeneratorTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/CodeModelGeneratorTest.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CodeModelGeneratorTest.cpp 10 Apr 2003 08:37:50 -0000 1.7 --- CodeModelGeneratorTest.cpp 21 Apr 2003 03:08:54 -0000 1.8 *************** *** 48,52 **** CodeModel::Generator generator; ! CodeModel::DeclaratorExpressionPtr &declExpression = generator.generateDeclarator( sourceNode_->getChildAt(0) ); --- 48,52 ---- CodeModel::Generator generator; ! CodeModel::DeclaratorExpressionPtr declExpression = generator.generateDeclarator( sourceNode_->getChildAt(0) ); *************** *** 63,67 **** dynamic_cast<CodeModel::AssignInitializerExpression &>( *(declarator->getInitializer()) ); RFTA_ASSERT_EQUAL( "3", initializer.getValue()->getSourceText() ); ! } --- 63,186 ---- dynamic_cast<CodeModel::AssignInitializerExpression &>( *(declarator->getInitializer()) ); RFTA_ASSERT_EQUAL( "3", initializer.getValue()->getSourceText() ); ! }; ! ! ////////////////////////////////////////////////// ! // Note: These are characterization tests to help ! // me understand what the code does; they do not ! // necessarily represent desired behavior. SR ! ////////////////////////////////////////////////// ! void ! CodeModelGeneratorTest::testGenerateDeclaratorExpression2() ! { ! source_ = "const int *x = NULL;"; ! ! parse(); ! RFTA_ASSERT_EQUAL( 1, sourceNode_->getChildCount() ); ! ! CodeModel::Generator generator; ! CodeModel::DeclaratorExpressionPtr declExpression = ! generator.generateDeclarator( sourceNode_->getChildAt(0) ); ! ! RFTA_ASSERT_EQUAL( "const int ", ! declExpression->getPrimaryType()->getTypeText() ); ! RFTA_ASSERT_EQUAL( 1, declExpression->getDeclaratorCount() ); ! ! CodeModel::DeclaratorPtr declarator = declExpression->getDeclaratorAt(0); ! CPPUNIT_ASSERT( declarator->hasType() ); ! RFTA_ASSERT_EQUAL( "*", declarator->getType()->getTypeText() ); ! CPPUNIT_ASSERT( !declarator->hasTypeSuffix() ); ! RFTA_ASSERT_EQUAL( "x", declarator->getName()->getIdentifier() ); ! CPPUNIT_ASSERT( declarator->hasInitializer() ); ! ! CodeModel::AssignInitializerExpression &initializer = ! dynamic_cast<CodeModel::AssignInitializerExpression &>( *(declarator->getInitializer()) ); ! RFTA_ASSERT_EQUAL( "NULL", initializer.getValue()->getSourceText() ); ! }; ! ! void ! CodeModelGeneratorTest::testGenerateDeclaratorExpression3() ! { ! source_ = "int *x = NULL, **y=&x, *const z;"; ! ! parse(); ! RFTA_ASSERT_EQUAL( 1, sourceNode_->getChildCount() ); ! ! CodeModel::Generator generator; ! CodeModel::DeclaratorExpressionPtr declExpression = ! generator.generateDeclarator( sourceNode_->getChildAt(0) ); ! ! RFTA_ASSERT_EQUAL( "int ", ! declExpression->getPrimaryType()->getTypeText() ); ! RFTA_ASSERT_EQUAL( 3, declExpression->getDeclaratorCount() ); ! ! CodeModel::DeclaratorPtr declarator = declExpression->getDeclaratorAt(0); ! CPPUNIT_ASSERT( declarator->hasType() ); ! CPPUNIT_ASSERT( !declarator->hasTypeSuffix() ); ! RFTA_ASSERT_EQUAL( "x", declarator->getName()->getIdentifier() ); ! CPPUNIT_ASSERT( declarator->hasInitializer() ); ! ! CodeModel::AssignInitializerExpression &initializer = ! dynamic_cast<CodeModel::AssignInitializerExpression &>( *(declarator->getInitializer()) ); ! RFTA_ASSERT_EQUAL( "NULL", initializer.getValue()->getSourceText() ); ! CodeModel::Change change( declarator->getTypeChange() ); ! CPPUNIT_ASSERT( change.isUnmodified() ); ! ////// ! ! CodeModel::DeclaratorPtr declarator2 = declExpression->getDeclaratorAt(1); ! CPPUNIT_ASSERT( declarator2->hasType() ); ! RFTA_ASSERT_EQUAL("**", declarator2->getType()->getTypeText() ); ! CPPUNIT_ASSERT( !declarator2->hasTypeSuffix() ); ! RFTA_ASSERT_EQUAL( "y", declarator2->getName()->getIdentifier() ); ! CPPUNIT_ASSERT( declarator2->hasInitializer() ); ! ! CodeModel::AssignInitializerExpression &initializer2 = ! dynamic_cast<CodeModel::AssignInitializerExpression &> ! ( *(declarator2->getInitializer()) ); ! RFTA_ASSERT_EQUAL( "&x", initializer2.getValue()->getSourceText() ); ! CodeModel::Change change2( declarator2->getTypeChange() ); ! CPPUNIT_ASSERT( change2.isUnmodified() ); ! ////// ! ! CodeModel::DeclaratorPtr declarator3 = declExpression->getDeclaratorAt(2); ! CPPUNIT_ASSERT( declarator3->hasType() ); ! // why do we get an extra space here? ! RFTA_ASSERT_EQUAL("*const ", declarator3->getType()->getTypeText() ); ! CPPUNIT_ASSERT( !declarator3->hasTypeSuffix() ); ! RFTA_ASSERT_EQUAL( "z", declarator3->getName()->getIdentifier() ); ! CPPUNIT_ASSERT( !declarator3->hasInitializer() ); ! CodeModel::Change change3( declarator3->getTypeChange() ); ! CPPUNIT_ASSERT( change3.isUnmodified() ); ! ! ////// ! ! }; ! ! // this crashes totally ! // More accurately, it tries to dereference a null ASTNodePtr ! void ! CodeModelGeneratorTest::testFunctionPointer() ! { ! source_ = "int (*f)(int);"; ! ! parse(); ! RFTA_ASSERT_EQUAL( 1, sourceNode_->getChildCount() ); ! ! CodeModel::Generator generator; ! CodeModel::DeclaratorExpressionPtr declExpression = ! generator.generateDeclarator( sourceNode_->getChildAt(0) ); ! ! RFTA_ASSERT_EQUAL( "int ", declExpression->getPrimaryType()->getTypeText() ); ! RFTA_ASSERT_EQUAL( 1, declExpression->getDeclaratorCount() ); ! ! CodeModel::DeclaratorPtr declarator = declExpression->getDeclaratorAt(0); ! CPPUNIT_ASSERT( !declarator->hasType() ); ! CPPUNIT_ASSERT( !declarator->hasTypeSuffix() ); ! RFTA_ASSERT_EQUAL( "x", declarator->getName()->getIdentifier() ); ! CPPUNIT_ASSERT( declarator->hasInitializer() ); ! ! CodeModel::AssignInitializerExpression &initializer = ! dynamic_cast<CodeModel::AssignInitializerExpression &>( *(declarator->getInitializer()) ); ! RFTA_ASSERT_EQUAL( "3", initializer.getValue()->getSourceText() ); ! }; Index: CodeModelExpressions.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/CodeModelExpressions.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** CodeModelExpressions.cpp 10 Apr 2003 08:37:50 -0000 1.14 --- CodeModelExpressions.cpp 21 Apr 2003 03:08:54 -0000 1.15 *************** *** 168,172 **** DeclaratorExpression::accept( ExpressionVisitor &visitor ) { ! visitor.visit( makeSharedFromThis(this) ); } --- 168,172 ---- DeclaratorExpression::accept( ExpressionVisitor &visitor ) { ! visitor.visit( *this ); } Index: CodeModelElement.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/CodeModelElement.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CodeModelElement.cpp 10 Apr 2003 08:37:50 -0000 1.10 --- CodeModelElement.cpp 21 Apr 2003 03:08:54 -0000 1.11 *************** *** 1,3 **** ! / ////////////////////////////////////////////////////////////////////////// // (c)Copyright 2002, Baptiste Lepilleur. // Created: 2002/12/22 --- 1,3 ---- ! /////////////////////////////////////////////////////////////////////////// // (c)Copyright 2002, Baptiste Lepilleur. // Created: 2002/12/22 Index: CodeModel.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/CodeModel.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CodeModel.cpp 10 Apr 2003 08:37:50 -0000 1.12 --- CodeModel.cpp 21 Apr 2003 03:08:54 -0000 1.13 *************** *** 10,14 **** #include <rfta/refactoring/CodeModelExpressions.h> #include <rfta/refactoring/CodeModelStatements.h> - namespace Refactoring { namespace CodeModel { --- 10,13 ---- |
From: <sve...@us...> - 2003-04-21 03:06:31
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv6288/src/rftaparser Modified Files: VariableDeclMutatorTest.h VariableDeclMutatorTest.cpp VariableDeclMutator.h VariableDeclMutator.cpp Log Message: improved declaration parsing Index: VariableDeclMutatorTest.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/VariableDeclMutatorTest.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** VariableDeclMutatorTest.h 30 Dec 2002 15:01:57 -0000 1.5 --- VariableDeclMutatorTest.h 21 Apr 2003 03:06:26 -0000 1.6 *************** *** 19,22 **** --- 19,23 ---- CPPUNIT_TEST_SUITE( VariableDeclMutatorTest ); CPPUNIT_TEST( testIntDecl ); + CPPUNIT_TEST( testPointerDecl ); CPPUNIT_TEST( testIntArrayDecl ); CPPUNIT_TEST( testTemplatedMapDecl ); *************** *** 48,51 **** --- 49,53 ---- void testIntDecl(); + void testPointerDecl(); void testIntArrayDecl(); void testTemplatedMapDecl(); Index: VariableDeclMutatorTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/VariableDeclMutatorTest.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** VariableDeclMutatorTest.cpp 6 Apr 2003 16:17:20 -0000 1.14 --- VariableDeclMutatorTest.cpp 21 Apr 2003 03:06:27 -0000 1.15 *************** *** 222,225 **** --- 222,237 ---- "int ", "", "xyz", "" ); } + void + VariableDeclMutatorTest::testPointerDecl() + { + + const std::string typePrefix( "int *" ); + //int variableNameIndex = typePrefix.length(); + const std::string source( typePrefix + "xyz;" ); + SourceASTNodePtr sourceAST = RFTA_ASSERT_VARIABLE_DECL_MUTATOR_PASS( source ); + RFTA_ASSERT_VARIABLE_DECL( sourceAST, 0, + "int ", "*", "xyz", "" ); + } + Index: VariableDeclMutator.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/VariableDeclMutator.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** VariableDeclMutator.h 6 Apr 2003 16:17:20 -0000 1.7 --- VariableDeclMutator.h 21 Apr 2003 03:06:27 -0000 1.8 *************** *** 36,39 **** --- 36,40 ---- bool backtrackSkippingOverArrayBrackets(); bool backtrackSkippingOverVariableIdentifier(); + bool backtrackSkippingOverTypeModifiers(); bool isValidTypePrefix( const char *prefixEnd ); static bool isValidSecondaryTypePrefix( const char *prefixStart, Index: VariableDeclMutator.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/VariableDeclMutator.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** VariableDeclMutator.cpp 6 Apr 2003 16:17:19 -0000 1.16 --- VariableDeclMutator.cpp 21 Apr 2003 03:06:27 -0000 1.17 *************** *** 50,53 **** --- 50,60 ---- // - type is not a keyword that may come before an identifier (new, sizeof) // (there might be other, we'll find out the hard way). + //////////////////////////////////////// + // TODO: IMO, type modifiers like "*", "&", and "* const" belong to the + // secondary prefix (this property is always left empty so far) + // The reason why we have to separate them from the primary prefix lies + // in declarations like + // int *x, y; + // where y is not a pointer. bool VariableDeclMutator::tryMutate() *************** *** 75,79 **** --- 82,92 ---- if ( current_ == start_ ) // no type before identifier ! return false; + // secondary prefix (*,&,*const) + const int secondaryPrefixEndIndex = getCurrentIndex(); + const char *secondaryPrefixEnd = current_; + if (! backtrackSkippingOverTypeModifiers() ) + return false; + int prefixEndIndex = getCurrentIndex(); const char *prefixEnd = current_; *************** *** 94,98 **** prefixEndIndex, // prefix end prefixEndIndex, // secondary prefix start ! prefixEndIndex, // variable name start suffixStartIndex, suffixEndIndex ); // position of last white space after ',' if many variable --- 107,111 ---- prefixEndIndex, // prefix end prefixEndIndex, // secondary prefix start ! secondaryPrefixEndIndex, // variable name start suffixStartIndex, suffixEndIndex ); // position of last white space after ',' if many variable *************** *** 170,173 **** --- 183,200 ---- } + + bool + VariableDeclMutator::backtrackSkippingOverTypeModifiers() + { + if (! hasPrevious()) + return false; + do current_ --; + while (isSymbolChar(*current_) && hasPrevious()); + current_++; + // track back to the first non-white character + while (*current_ == ' ') + ++current_; + return true; + }; bool |
From: <sve...@us...> - 2003-04-21 03:05:10
|
Update of /cvsroot/cpptool/rfta/src/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv5252/src/rfta Modified Files: IndentLevelManager.h Log Message: added <deque> include for Linux Index: IndentLevelManager.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/IndentLevelManager.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** IndentLevelManager.h 18 Mar 2003 22:37:51 -0000 1.10 --- IndentLevelManager.h 21 Apr 2003 03:05:04 -0000 1.11 *************** *** 8,12 **** #include <rfta/refactoring/CodeModelForward.h> #include <string> ! namespace Refactoring { --- 8,14 ---- #include <rfta/refactoring/CodeModelForward.h> #include <string> ! #ifndef _MSC_VER ! # include <deque> ! #endif // _MSC_VER namespace Refactoring { |
From: <sve...@us...> - 2003-04-21 03:03:20
|
Update of /cvsroot/cpptool/rfta/src/astdumper In directory sc8-pr-cvs1:/tmp/cvs-serv2713/src/astdumper Modified Files: Makefile.in Makefile.am Log Message: updated makefiles Index: Makefile.in =================================================================== RCS file: /cvsroot/cpptool/rfta/src/astdumper/Makefile.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.in 2 Dec 2002 16:53:39 -0000 1.1 --- Makefile.in 21 Apr 2003 03:02:46 -0000 1.2 *************** *** 71,75 **** ! ASTDumper_LDADD = -L$(top_builddir)/src/rftaparser -L$(top_builddir)/src/rfta -L$(top_builddir)/deplib/boostcvs/libs/filesystem/src -lrfta -lrftatools -lfs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs --- 71,75 ---- ! ASTDumper_LDADD = -L$(top_builddir)/src/rftaparser -L$(top_builddir)/src/rfta -L$(top_builddir)/deplib/boostcvs/libs/filesystem/src -lrftaparser -lrfta -lfs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs Index: Makefile.am =================================================================== RCS file: /cvsroot/cpptool/rfta/src/astdumper/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 2 Dec 2002 16:53:40 -0000 1.1 --- Makefile.am 21 Apr 2003 03:02:46 -0000 1.2 *************** *** 10,12 **** -L$(top_builddir)/src/rfta\ -L$(top_builddir)/deplib/boostcvs/libs/filesystem/src\ ! -lrfta -lrftatools -lfs --- 10,12 ---- -L$(top_builddir)/src/rfta\ -L$(top_builddir)/deplib/boostcvs/libs/filesystem/src\ ! -lrftaparser -lrfta -lfs |
From: <sve...@us...> - 2003-04-21 03:03:20
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv2713/src/rftaparser Modified Files: Makefile.in Makefile.am Log Message: updated makefiles Index: Makefile.in =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/Makefile.in,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.in 2 Dec 2002 16:47:49 -0000 1.9 --- Makefile.in 21 Apr 2003 03:02:43 -0000 1.10 *************** *** 66,78 **** INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include ! noinst_LIBRARIES = librfta.a check_PROGRAMS = UnitTests TESTS = ./UnitTests ! librfta_a_SOURCES = ASTNode.cpp ASTNodeRange.cpp ASTNodes.cpp ASTNodeAndPropertyVisitor.cpp ASTNodePropertyVisitor.cpp ASTNodeVisitor.cpp CaseStatementParser.cpp CatchStatementParser.cpp CompoundStatementParser.cpp DeclarationOrExpressionMutator.cpp DeclarationOrExpressionParser.cpp DefaultStatementParser.cpp DoWhileStatementParser.cpp ExpressionIdentifierMutator.cpp ExpressionMutator.cpp FlowControlStatementParser.cpp ForStatementParser.cpp IfStatementParser.cpp KeywordStatementParser.cpp MaxLODMutator.cpp Mutator.cpp NonSemanticBlanker.cpp NullStatementParser.cpp ParseContext.cpp Parser.cpp ParserError.cpp ReturnStatementParser.cpp ReturnStatementParser.cpp SourceASTNode.cpp StatementParser.cpp StatementsParser.cpp StdAfx.cpp SwitchStatementParser.cpp TryStatementParser.cpp TypeDeclarationStatementParser.cpp UnparsedCompoundMutator.cpp VariableDeclMutator.cpp WhileStatementParser.cpp ! UnitTests_SOURCES = UnitTests.cpp ASTNodeRange.cpp ASTNodeRangeTest.cpp CaseStatementParserTest.cpp CompoundStatementParserTest.cpp DeclarationOrExpressionParserTest.cpp ExpressionMutatorTest.cpp IfStatementParserTest.cpp KeywordStatementParserTest.cpp NonSemanticBlankerTest.cpp NullStatementParserTest.cpp ParseContextTest.cpp RftaParserTest.cpp StatementParserTest.cpp StatementsParserTest.cpp SwitchStatementParserTest.cpp TypeDeclarationStatementParserTest.cpp UnparsedCompoundMutatorTest.cpp VariableDeclMutatorTest.cpp ! UnitTests_LDADD = -L. -lrfta -L$(top_builddir)/lib -lcppunit -ldl ! UnitTests_DEPENDENCIES = librfta.a mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = --- 66,78 ---- INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include ! noinst_LIBRARIES = librftaparser.a check_PROGRAMS = UnitTests TESTS = ./UnitTests ! librftaparser_a_SOURCES = ASTNodeAndPropertyVisitor.cpp ASTNode.cpp ASTNodePropertyVisitor.cpp ASTNodes.cpp ASTNodeVisitor.cpp CaseStatementParser.cpp CatchStatementParser.cpp CompoundStatementParser.cpp DeclarationListParser.cpp DeclarationOrExpressionMutator.cpp DeclarationOrExpressionParser.cpp DeclarationParser.cpp DefaultStatementParser.cpp DoWhileStatementParser.cpp ExpressionIdentifierMutator.cpp ExpressionMutator.cpp ExpressionOperationMutator.cpp FlowControlStatementParser.cpp ForIterationExpressionParser.cpp ForStatementParser.cpp IfStatementParser.cpp KeywordStatementParser.cpp LinkageParser.cpp MaxLODMutator.cpp Mutator.cpp NamespaceParser.cpp NonSemanticBlanker.cpp NullStatementParser.cpp ParseContext.cpp Parser.cpp ParserError.cpp ReturnStatementParser.cpp rftaparser.cpp SourceASTNode.cpp SourceRange.cpp StatementParser.cpp StatementsParser.cpp StdAfx.cpp SwitchStatementParser.cpp TemplateDeclarationParser.cpp TryStatementParser.cpp TypeDeclarationStatementParser.cpp UnitTests.cpp UnparsedCompoundMutator.cpp UnparsedDeclarationListMutator.cpp UsingNamespaceParser.cpp VariableDeclMutator.cpp WhileStatementParser.cpp ! UnitTests_SOURCES = CaseStatementParserTest.cpp CompoundStatementParserTest.cpp DeclarationListParserTest.cpp DeclarationOrExpressionParserTest.cpp DeclarationParserTest.cpp ExpressionMutatorTest.cpp ExpressionOperationMutatorTest.cpp ForStatementParserTest.cpp IfStatementParserTest.cpp KeywordStatementParserTest.cpp NonSemanticBlankerTest.cpp NullStatementParserTest.cpp ParseContextTest.cpp ReturnStatementParserTest.cpp RftaParserTest.cpp SourceRangeTest.cpp StatementParserTest.cpp StatementsParserTest.cpp SwitchStatementParserTest.cpp TypeDeclarationStatementParserTest.cpp UnitTests.cpp UnparsedCompoundMutatorTest.cpp UnparsedDeclarationListMutatorTest.cpp VariableDeclMutatorTest.cpp ! UnitTests_LDADD = -L. -lrftaparser -L$(top_builddir)/lib -lcppunit -ldl ! UnitTests_DEPENDENCIES = librftaparser.a mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = *************** *** 84,110 **** LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ ! librfta_a_LIBADD = ! librfta_a_OBJECTS = ASTNode.o ASTNodeRange.o ASTNodes.o \ ! ASTNodeAndPropertyVisitor.o ASTNodePropertyVisitor.o ASTNodeVisitor.o \ CaseStatementParser.o CatchStatementParser.o CompoundStatementParser.o \ ! DeclarationOrExpressionMutator.o DeclarationOrExpressionParser.o \ DefaultStatementParser.o DoWhileStatementParser.o \ ExpressionIdentifierMutator.o ExpressionMutator.o \ ! FlowControlStatementParser.o ForStatementParser.o IfStatementParser.o \ ! KeywordStatementParser.o MaxLODMutator.o Mutator.o NonSemanticBlanker.o \ ! NullStatementParser.o ParseContext.o Parser.o ParserError.o \ ! ReturnStatementParser.o ReturnStatementParser.o SourceASTNode.o \ ! StatementParser.o StatementsParser.o StdAfx.o SwitchStatementParser.o \ ! TryStatementParser.o TypeDeclarationStatementParser.o \ ! UnparsedCompoundMutator.o VariableDeclMutator.o WhileStatementParser.o AR = ar ! UnitTests_OBJECTS = UnitTests.o ASTNodeRange.o ASTNodeRangeTest.o \ ! CaseStatementParserTest.o CompoundStatementParserTest.o \ ! DeclarationOrExpressionParserTest.o ExpressionMutatorTest.o \ ! IfStatementParserTest.o KeywordStatementParserTest.o \ ! NonSemanticBlankerTest.o NullStatementParserTest.o ParseContextTest.o \ ! RftaParserTest.o StatementParserTest.o StatementsParserTest.o \ SwitchStatementParserTest.o TypeDeclarationStatementParserTest.o \ ! UnparsedCompoundMutatorTest.o VariableDeclMutatorTest.o UnitTests_LDFLAGS = CXXFLAGS = @CXXFLAGS@ --- 84,119 ---- LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ ! librftaparser_a_LIBADD = ! librftaparser_a_OBJECTS = ASTNodeAndPropertyVisitor.o ASTNode.o \ ! ASTNodePropertyVisitor.o ASTNodes.o ASTNodeVisitor.o \ CaseStatementParser.o CatchStatementParser.o CompoundStatementParser.o \ ! DeclarationListParser.o DeclarationOrExpressionMutator.o \ ! DeclarationOrExpressionParser.o DeclarationParser.o \ DefaultStatementParser.o DoWhileStatementParser.o \ ExpressionIdentifierMutator.o ExpressionMutator.o \ ! ExpressionOperationMutator.o FlowControlStatementParser.o \ ! ForIterationExpressionParser.o ForStatementParser.o IfStatementParser.o \ ! KeywordStatementParser.o LinkageParser.o MaxLODMutator.o Mutator.o \ ! NamespaceParser.o NonSemanticBlanker.o NullStatementParser.o \ ! ParseContext.o Parser.o ParserError.o ReturnStatementParser.o \ ! rftaparser.o SourceASTNode.o SourceRange.o StatementParser.o \ ! StatementsParser.o StdAfx.o SwitchStatementParser.o \ ! TemplateDeclarationParser.o TryStatementParser.o \ ! TypeDeclarationStatementParser.o UnitTests.o UnparsedCompoundMutator.o \ ! UnparsedDeclarationListMutator.o UsingNamespaceParser.o \ ! VariableDeclMutator.o WhileStatementParser.o AR = ar ! UnitTests_OBJECTS = CaseStatementParserTest.o \ ! CompoundStatementParserTest.o DeclarationListParserTest.o \ ! DeclarationOrExpressionParserTest.o DeclarationParserTest.o \ ! ExpressionMutatorTest.o ExpressionOperationMutatorTest.o \ ! ForStatementParserTest.o IfStatementParserTest.o \ ! KeywordStatementParserTest.o NonSemanticBlankerTest.o \ ! NullStatementParserTest.o ParseContextTest.o \ ! ReturnStatementParserTest.o RftaParserTest.o SourceRangeTest.o \ ! StatementParserTest.o StatementsParserTest.o \ SwitchStatementParserTest.o TypeDeclarationStatementParserTest.o \ ! UnitTests.o UnparsedCompoundMutatorTest.o \ ! UnparsedDeclarationListMutatorTest.o VariableDeclMutatorTest.o UnitTests_LDFLAGS = CXXFLAGS = @CXXFLAGS@ *************** *** 120,153 **** GZIP_ENV = --best DEP_FILES = .deps/ASTNode.P .deps/ASTNodeAndPropertyVisitor.P \ ! .deps/ASTNodePropertyVisitor.P .deps/ASTNodeRange.P \ ! .deps/ASTNodeRangeTest.P .deps/ASTNodeVisitor.P .deps/ASTNodes.P \ .deps/CaseStatementParser.P .deps/CaseStatementParserTest.P \ .deps/CatchStatementParser.P .deps/CompoundStatementParser.P \ ! .deps/CompoundStatementParserTest.P \ .deps/DeclarationOrExpressionMutator.P \ .deps/DeclarationOrExpressionParser.P \ ! .deps/DeclarationOrExpressionParserTest.P \ ! .deps/DefaultStatementParser.P .deps/DoWhileStatementParser.P \ ! .deps/ExpressionIdentifierMutator.P .deps/ExpressionMutator.P \ ! .deps/ExpressionMutatorTest.P .deps/FlowControlStatementParser.P \ ! .deps/ForStatementParser.P .deps/IfStatementParser.P \ ! .deps/IfStatementParserTest.P .deps/KeywordStatementParser.P \ ! .deps/KeywordStatementParserTest.P .deps/MaxLODMutator.P \ ! .deps/Mutator.P .deps/NonSemanticBlanker.P \ .deps/NonSemanticBlankerTest.P .deps/NullStatementParser.P \ .deps/NullStatementParserTest.P .deps/ParseContext.P \ .deps/ParseContextTest.P .deps/Parser.P .deps/ParserError.P \ ! .deps/ReturnStatementParser.P .deps/RftaParserTest.P \ ! .deps/SourceASTNode.P .deps/StatementParser.P \ .deps/StatementParserTest.P .deps/StatementsParser.P \ .deps/StatementsParserTest.P .deps/StdAfx.P \ .deps/SwitchStatementParser.P .deps/SwitchStatementParserTest.P \ ! .deps/TryStatementParser.P .deps/TypeDeclarationStatementParser.P \ .deps/TypeDeclarationStatementParserTest.P .deps/UnitTests.P \ .deps/UnparsedCompoundMutator.P .deps/UnparsedCompoundMutatorTest.P \ .deps/VariableDeclMutator.P .deps/VariableDeclMutatorTest.P \ ! .deps/WhileStatementParser.P ! SOURCES = $(librfta_a_SOURCES) $(UnitTests_SOURCES) ! OBJECTS = $(librfta_a_OBJECTS) $(UnitTests_OBJECTS) all: all-redirect --- 129,170 ---- GZIP_ENV = --best DEP_FILES = .deps/ASTNode.P .deps/ASTNodeAndPropertyVisitor.P \ ! .deps/ASTNodePropertyVisitor.P .deps/ASTNodeVisitor.P .deps/ASTNodes.P \ .deps/CaseStatementParser.P .deps/CaseStatementParserTest.P \ .deps/CatchStatementParser.P .deps/CompoundStatementParser.P \ ! .deps/CompoundStatementParserTest.P .deps/DeclarationListParser.P \ ! .deps/DeclarationListParserTest.P \ .deps/DeclarationOrExpressionMutator.P \ .deps/DeclarationOrExpressionParser.P \ ! .deps/DeclarationOrExpressionParserTest.P .deps/DeclarationParser.P \ ! .deps/DeclarationParserTest.P .deps/DefaultStatementParser.P \ ! .deps/DoWhileStatementParser.P .deps/ExpressionIdentifierMutator.P \ ! .deps/ExpressionMutator.P .deps/ExpressionMutatorTest.P \ ! .deps/ExpressionOperationMutator.P \ ! .deps/ExpressionOperationMutatorTest.P \ ! .deps/FlowControlStatementParser.P .deps/ForIterationExpressionParser.P \ ! .deps/ForStatementParser.P .deps/ForStatementParserTest.P \ ! .deps/IfStatementParser.P .deps/IfStatementParserTest.P \ ! .deps/KeywordStatementParser.P .deps/KeywordStatementParserTest.P \ ! .deps/LinkageParser.P .deps/MaxLODMutator.P .deps/Mutator.P \ ! .deps/NamespaceParser.P .deps/NonSemanticBlanker.P \ .deps/NonSemanticBlankerTest.P .deps/NullStatementParser.P \ .deps/NullStatementParserTest.P .deps/ParseContext.P \ .deps/ParseContextTest.P .deps/Parser.P .deps/ParserError.P \ ! .deps/ReturnStatementParser.P .deps/ReturnStatementParserTest.P \ ! .deps/RftaParserTest.P .deps/SourceASTNode.P .deps/SourceRange.P \ ! .deps/SourceRangeTest.P .deps/StatementParser.P \ .deps/StatementParserTest.P .deps/StatementsParser.P \ .deps/StatementsParserTest.P .deps/StdAfx.P \ .deps/SwitchStatementParser.P .deps/SwitchStatementParserTest.P \ ! .deps/TemplateDeclarationParser.P .deps/TryStatementParser.P \ ! .deps/TypeDeclarationStatementParser.P \ .deps/TypeDeclarationStatementParserTest.P .deps/UnitTests.P \ .deps/UnparsedCompoundMutator.P .deps/UnparsedCompoundMutatorTest.P \ + .deps/UnparsedDeclarationListMutator.P \ + .deps/UnparsedDeclarationListMutatorTest.P .deps/UsingNamespaceParser.P \ .deps/VariableDeclMutator.P .deps/VariableDeclMutatorTest.P \ ! .deps/WhileStatementParser.P .deps/rftaparser.P ! SOURCES = $(librftaparser_a_SOURCES) $(UnitTests_SOURCES) ! OBJECTS = $(librftaparser_a_OBJECTS) $(UnitTests_OBJECTS) all: all-redirect *************** *** 187,194 **** maintainer-clean-compile: ! librfta.a: $(librfta_a_OBJECTS) $(librfta_a_DEPENDENCIES) ! -rm -f librfta.a ! $(AR) cru librfta.a $(librfta_a_OBJECTS) $(librfta_a_LIBADD) ! $(RANLIB) librfta.a mostlyclean-checkPROGRAMS: --- 204,211 ---- maintainer-clean-compile: ! librftaparser.a: $(librftaparser_a_OBJECTS) $(librftaparser_a_DEPENDENCIES) ! -rm -f librftaparser.a ! $(AR) cru librftaparser.a $(librftaparser_a_OBJECTS) $(librftaparser_a_LIBADD) ! $(RANLIB) librftaparser.a mostlyclean-checkPROGRAMS: Index: Makefile.am =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Makefile.am 27 Nov 2002 21:58:38 -0000 1.11 --- Makefile.am 21 Apr 2003 03:02:44 -0000 1.12 *************** *** 1,29 **** INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include ! noinst_LIBRARIES = librfta.a check_PROGRAMS = UnitTests TESTS = ./UnitTests ! librfta_a_SOURCES = \ ASTNode.cpp\ - ASTNodeRange.cpp\ - ASTNodes.cpp\ - ASTNodeAndPropertyVisitor.cpp\ ASTNodePropertyVisitor.cpp\ ASTNodeVisitor.cpp\ CaseStatementParser.cpp\ CatchStatementParser.cpp\ CompoundStatementParser.cpp\ DeclarationOrExpressionMutator.cpp\ DeclarationOrExpressionParser.cpp\ DefaultStatementParser.cpp\ DoWhileStatementParser.cpp\ ExpressionIdentifierMutator.cpp\ ExpressionMutator.cpp\ FlowControlStatementParser.cpp\ ForStatementParser.cpp\ IfStatementParser.cpp\ ! KeywordStatementParser.cpp \ ! MaxLODMutator.cpp \ Mutator.cpp\ ! NonSemanticBlanker.cpp \ NullStatementParser.cpp\ ParseContext.cpp\ --- 1,33 ---- INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include ! noinst_LIBRARIES = librftaparser.a check_PROGRAMS = UnitTests TESTS = ./UnitTests ! librftaparser_a_SOURCES = ASTNodeAndPropertyVisitor.cpp\ ASTNode.cpp\ ASTNodePropertyVisitor.cpp\ + ASTNodes.cpp\ ASTNodeVisitor.cpp\ CaseStatementParser.cpp\ CatchStatementParser.cpp\ CompoundStatementParser.cpp\ + DeclarationListParser.cpp\ DeclarationOrExpressionMutator.cpp\ DeclarationOrExpressionParser.cpp\ + DeclarationParser.cpp\ DefaultStatementParser.cpp\ DoWhileStatementParser.cpp\ ExpressionIdentifierMutator.cpp\ ExpressionMutator.cpp\ + ExpressionOperationMutator.cpp\ FlowControlStatementParser.cpp\ + ForIterationExpressionParser.cpp\ ForStatementParser.cpp\ IfStatementParser.cpp\ ! KeywordStatementParser.cpp\ ! LinkageParser.cpp\ ! MaxLODMutator.cpp\ Mutator.cpp\ ! NamespaceParser.cpp\ ! NonSemanticBlanker.cpp\ NullStatementParser.cpp\ ParseContext.cpp\ *************** *** 31,52 **** ParserError.cpp\ ReturnStatementParser.cpp\ ! ReturnStatementParser.cpp\ SourceASTNode.cpp\ StatementParser.cpp\ StatementsParser.cpp\ StdAfx.cpp\ SwitchStatementParser.cpp\ TryStatementParser.cpp\ TypeDeclarationStatementParser.cpp\ UnparsedCompoundMutator.cpp\ VariableDeclMutator.cpp\ ! WhileStatementParser.cpp ! UnitTests_SOURCES = UnitTests.cpp\ ! ASTNodeRange.cpp\ ! ASTNodeRangeTest.cpp\ CaseStatementParserTest.cpp\ CompoundStatementParserTest.cpp\ DeclarationOrExpressionParserTest.cpp\ ! ExpressionMutatorTest.cpp\ IfStatementParserTest.cpp\ KeywordStatementParserTest.cpp\ --- 35,63 ---- ParserError.cpp\ ReturnStatementParser.cpp\ ! rftaparser.cpp\ SourceASTNode.cpp\ + SourceRange.cpp\ StatementParser.cpp\ StatementsParser.cpp\ StdAfx.cpp\ SwitchStatementParser.cpp\ + TemplateDeclarationParser.cpp\ TryStatementParser.cpp\ TypeDeclarationStatementParser.cpp\ + UnitTests.cpp\ UnparsedCompoundMutator.cpp\ + UnparsedDeclarationListMutator.cpp\ + UsingNamespaceParser.cpp\ VariableDeclMutator.cpp\ ! WhileStatementParser.cpp ! UnitTests_SOURCES =\ CaseStatementParserTest.cpp\ CompoundStatementParserTest.cpp\ + DeclarationListParserTest.cpp\ DeclarationOrExpressionParserTest.cpp\ ! DeclarationParserTest.cpp\ ! ExpressionMutatorTest.cpp\ ! ExpressionOperationMutatorTest.cpp\ ! ForStatementParserTest.cpp\ IfStatementParserTest.cpp\ KeywordStatementParserTest.cpp\ *************** *** 54,64 **** NullStatementParserTest.cpp\ ParseContextTest.cpp\ RftaParserTest.cpp\ StatementParserTest.cpp\ StatementsParserTest.cpp\ SwitchStatementParserTest.cpp\ TypeDeclarationStatementParserTest.cpp\ UnparsedCompoundMutatorTest.cpp\ VariableDeclMutatorTest.cpp ! UnitTests_LDADD = -L. -lrfta -L$(top_builddir)/lib -lcppunit -ldl ! UnitTests_DEPENDENCIES = librfta.a --- 65,79 ---- NullStatementParserTest.cpp\ ParseContextTest.cpp\ + ReturnStatementParserTest.cpp\ RftaParserTest.cpp\ + SourceRangeTest.cpp\ StatementParserTest.cpp\ StatementsParserTest.cpp\ SwitchStatementParserTest.cpp\ TypeDeclarationStatementParserTest.cpp\ + UnitTests.cpp\ UnparsedCompoundMutatorTest.cpp\ + UnparsedDeclarationListMutatorTest.cpp\ VariableDeclMutatorTest.cpp ! UnitTests_LDADD = -L. -lrftaparser -L$(top_builddir)/lib -lcppunit -ldl ! UnitTests_DEPENDENCIES = librftaparser.a |
From: <sve...@us...> - 2003-04-21 03:03:19
|
Update of /cvsroot/cpptool/rfta/src/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv2713/src/rfta Modified Files: Makefile.in Makefile.am Log Message: updated makefiles Index: Makefile.in =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/Makefile.in,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.in 15 Dec 2002 02:39:21 -0000 1.8 --- Makefile.in 21 Apr 2003 03:02:45 -0000 1.9 *************** *** 66,80 **** INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include ! noinst_LIBRARIES = librftatools.a check_PROGRAMS = UnitTests TESTS = ./UnitTests ! librftatools_a_SOURCES = IdentifierResolver.cpp IdentifierResolverContext.cpp IdentifierVisitor.cpp LineBasedTextDocument.cpp ParserTools.cpp PlainTextDocument.cpp RenameTempRefactoring.cpp RefactoringBase.cpp RefactoringError.cpp ReplaceTextTransform.cpp Scope.cpp ScopeBuilder.cpp ScopeGenerator.cpp ScopesHolder.cpp SourceBasedTestBase.cpp SourceLocationRange.cpp SourceBuilder.cpp SplitTempRefactoring.cpp StdAfx.cpp TextDocument.cpp ToolsBox.cpp TransformList.cpp VariableDeclCollector.cpp VariableDeclVisitor.cpp rfta.cpp ! ! UnitTests_SOURCES = IdentifierVisitorTest.cpp LineBasedTextDocumentTest.cpp MockLineBasedTextDocument.cpp MockTextDocument.cpp RenameTempRefactoringTest.cpp ReplaceTextTransformTest.cpp ScopeGeneratorTest.cpp ScopesHolderTest.cpp ScopeGeneratorTestBase.cpp SourceBasedTestBase.cpp SplitTempRefactoringTest.cpp ToolsBoxTest.cpp TransformListTest.cpp VariableDeclCollectorTest.cpp VariableDeclVisitorTest.cpp UnitTests.cpp RftaTest.cpp ! ! UnitTests_LDADD = -L$(top_builddir)/lib -lcppunit -ldl -L../rftaparser -L. -lrftatools -lrfta ! UnitTests_DEPENDENCIES = librftatools.a ../rftaparser/librfta.a mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = --- 66,78 ---- INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include ! noinst_LIBRARIES = librfta.a check_PROGRAMS = UnitTests TESTS = ./UnitTests ! librfta_a_SOURCES = CodeModel.cpp CodeModelElement.cpp CodeModelExpressions.cpp CodeModelStatements.cpp CodeRewriter.cpp IdentifierResolverContext.cpp IdentifierResolver.cpp IdentifierResolverStrategy.cpp IdentifierVisitor.cpp IndentLevelManager.cpp InlineTempRefactoring.cpp LineBasedTextDocument.cpp MockIdentifierResolverStrategy.cpp MockLineBasedTextDocument.cpp MockTextDocument.cpp ParserTools.cpp PlainTextDocument.cpp ReduceTempScopeRefactoring.cpp RefactoringBase.cpp RefactoringError.cpp RenameTempRefactoring.cpp ReplaceTextTransform.cpp rfta.cpp SourceBuilder.cpp SplitDeclarationRefactoring.cpp SplitTempRefactoring.cpp StatementsVisitor.cpp StdAfx.cpp TextDocument.cpp ToolsBox.cpp TransformList.cpp VariableDeclCollector.cpp VariableDeclVisitor.cpp ! UnitTests_SOURCES = UnitTests.cpp CodeModelGeneratorTest.cpp CodeWriterInsertTest.cpp CodeWriterTestBase.cpp CodeWriterTest.cpp IdentifierResolverContextTest.cpp IdentifierResolverTest.cpp IdentifierVisitorTest.cpp InlineTempRefactoringTest.cpp LineBasedTextDocumentTest.cpp ReduceTempScopeRefactoringTest.cpp RenameTempRefactoringTest.cpp ReplaceTextTransformTest.cpp RftaTest.cpp SourceBasedTestBase.cpp SplitDeclarationRefactoringTest.cpp SplitTempRefactoringTest.cpp ToolsBoxTest.cpp TransformListTest.cpp VariableDeclCollectorTest.cpp VariableDeclVisitorTest.cpp ! UnitTests_LDADD = -L$(top_builddir)/lib -L../rftaparser -L. -lrfta -lrftaparser -lcppunit -ldl ! UnitTests_DEPENDENCIES = librfta.a ../rftaparser/librftaparser.a mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = *************** *** 86,106 **** LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ ! librftatools_a_LIBADD = ! librftatools_a_OBJECTS = IdentifierResolver.o \ ! IdentifierResolverContext.o IdentifierVisitor.o LineBasedTextDocument.o \ ! ParserTools.o PlainTextDocument.o RenameTempRefactoring.o \ ! RefactoringBase.o RefactoringError.o ReplaceTextTransform.o Scope.o \ ! ScopeBuilder.o ScopeGenerator.o ScopesHolder.o SourceBasedTestBase.o \ ! SourceLocationRange.o SourceBuilder.o SplitTempRefactoring.o StdAfx.o \ ! TextDocument.o ToolsBox.o TransformList.o VariableDeclCollector.o \ ! VariableDeclVisitor.o rfta.o AR = ar ! UnitTests_OBJECTS = IdentifierVisitorTest.o LineBasedTextDocumentTest.o \ ! MockLineBasedTextDocument.o MockTextDocument.o \ ! RenameTempRefactoringTest.o ReplaceTextTransformTest.o \ ! ScopeGeneratorTest.o ScopesHolderTest.o ScopeGeneratorTestBase.o \ ! SourceBasedTestBase.o SplitTempRefactoringTest.o ToolsBoxTest.o \ ! TransformListTest.o VariableDeclCollectorTest.o \ ! VariableDeclVisitorTest.o UnitTests.o RftaTest.o UnitTests_LDFLAGS = CXXFLAGS = @CXXFLAGS@ --- 84,110 ---- LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ ! librfta_a_LIBADD = ! librfta_a_OBJECTS = CodeModel.o CodeModelElement.o \ ! CodeModelExpressions.o CodeModelStatements.o CodeRewriter.o \ ! IdentifierResolverContext.o IdentifierResolver.o \ ! IdentifierResolverStrategy.o IdentifierVisitor.o IndentLevelManager.o \ ! InlineTempRefactoring.o LineBasedTextDocument.o \ ! MockIdentifierResolverStrategy.o MockLineBasedTextDocument.o \ ! MockTextDocument.o ParserTools.o PlainTextDocument.o \ ! ReduceTempScopeRefactoring.o RefactoringBase.o RefactoringError.o \ ! RenameTempRefactoring.o ReplaceTextTransform.o rfta.o SourceBuilder.o \ ! SplitDeclarationRefactoring.o SplitTempRefactoring.o \ ! StatementsVisitor.o StdAfx.o TextDocument.o ToolsBox.o TransformList.o \ ! VariableDeclCollector.o VariableDeclVisitor.o AR = ar ! UnitTests_OBJECTS = UnitTests.o CodeModelGeneratorTest.o \ ! CodeWriterInsertTest.o CodeWriterTestBase.o CodeWriterTest.o \ ! IdentifierResolverContextTest.o IdentifierResolverTest.o \ ! IdentifierVisitorTest.o InlineTempRefactoringTest.o \ ! LineBasedTextDocumentTest.o ReduceTempScopeRefactoringTest.o \ ! RenameTempRefactoringTest.o ReplaceTextTransformTest.o RftaTest.o \ ! SourceBasedTestBase.o SplitDeclarationRefactoringTest.o \ ! SplitTempRefactoringTest.o ToolsBoxTest.o TransformListTest.o \ ! VariableDeclCollectorTest.o VariableDeclVisitorTest.o UnitTests_LDFLAGS = CXXFLAGS = @CXXFLAGS@ *************** *** 115,132 **** TAR = gtar GZIP_ENV = --best ! DEP_FILES = .deps/IdentifierResolver.P \ ! .deps/IdentifierResolverContext.P .deps/IdentifierVisitor.P \ ! .deps/IdentifierVisitorTest.P .deps/LineBasedTextDocument.P \ ! .deps/LineBasedTextDocumentTest.P .deps/MockLineBasedTextDocument.P \ ! .deps/MockTextDocument.P .deps/ParserTools.P .deps/PlainTextDocument.P \ ! .deps/RefactoringBase.P .deps/RefactoringError.P \ ! .deps/RenameTempRefactoring.P .deps/RenameTempRefactoringTest.P \ ! .deps/ReplaceTextTransform.P .deps/ReplaceTextTransformTest.P \ ! .deps/RftaTest.P .deps/Scope.P .deps/ScopeBuilder.P \ ! .deps/ScopeGenerator.P .deps/ScopeGeneratorTest.P \ ! .deps/ScopeGeneratorTestBase.P .deps/ScopesHolder.P \ ! .deps/ScopesHolderTest.P .deps/SourceBasedTestBase.P \ ! .deps/SourceBuilder.P .deps/SourceLocationRange.P \ ! .deps/SplitTempRefactoring.P .deps/SplitTempRefactoringTest.P \ .deps/StdAfx.P .deps/TextDocument.P .deps/ToolsBox.P \ .deps/ToolsBoxTest.P .deps/TransformList.P .deps/TransformListTest.P \ --- 119,145 ---- TAR = gtar GZIP_ENV = --best ! DEP_FILES = .deps/CodeModel.P .deps/CodeModelElement.P \ ! .deps/CodeModelExpressions.P .deps/CodeModelGeneratorTest.P \ ! .deps/CodeModelStatements.P .deps/CodeRewriter.P \ ! .deps/CodeWriterInsertTest.P .deps/CodeWriterTest.P \ ! .deps/CodeWriterTestBase.P .deps/IdentifierResolver.P \ ! .deps/IdentifierResolverContext.P .deps/IdentifierResolverContextTest.P \ ! .deps/IdentifierResolverStrategy.P .deps/IdentifierResolverTest.P \ ! .deps/IdentifierVisitor.P .deps/IdentifierVisitorTest.P \ ! .deps/IndentLevelManager.P .deps/InlineTempRefactoring.P \ ! .deps/InlineTempRefactoringTest.P .deps/LineBasedTextDocument.P \ ! .deps/LineBasedTextDocumentTest.P \ ! .deps/MockIdentifierResolverStrategy.P \ ! .deps/MockLineBasedTextDocument.P .deps/MockTextDocument.P \ ! .deps/ParserTools.P .deps/PlainTextDocument.P \ ! .deps/ReduceTempScopeRefactoring.P \ ! .deps/ReduceTempScopeRefactoringTest.P .deps/RefactoringBase.P \ ! .deps/RefactoringError.P .deps/RenameTempRefactoring.P \ ! .deps/RenameTempRefactoringTest.P .deps/ReplaceTextTransform.P \ ! .deps/ReplaceTextTransformTest.P .deps/RftaTest.P \ ! .deps/SourceBasedTestBase.P .deps/SourceBuilder.P \ ! .deps/SplitDeclarationRefactoring.P \ ! .deps/SplitDeclarationRefactoringTest.P .deps/SplitTempRefactoring.P \ ! .deps/SplitTempRefactoringTest.P .deps/StatementsVisitor.P \ .deps/StdAfx.P .deps/TextDocument.P .deps/ToolsBox.P \ .deps/ToolsBoxTest.P .deps/TransformList.P .deps/TransformListTest.P \ *************** *** 134,139 **** .deps/VariableDeclCollectorTest.P .deps/VariableDeclVisitor.P \ .deps/VariableDeclVisitorTest.P .deps/rfta.P ! SOURCES = $(librftatools_a_SOURCES) $(UnitTests_SOURCES) ! OBJECTS = $(librftatools_a_OBJECTS) $(UnitTests_OBJECTS) all: all-redirect --- 147,152 ---- .deps/VariableDeclCollectorTest.P .deps/VariableDeclVisitor.P \ .deps/VariableDeclVisitorTest.P .deps/rfta.P ! SOURCES = $(librfta_a_SOURCES) $(UnitTests_SOURCES) ! OBJECTS = $(librfta_a_OBJECTS) $(UnitTests_OBJECTS) all: all-redirect *************** *** 173,180 **** maintainer-clean-compile: ! librftatools.a: $(librftatools_a_OBJECTS) $(librftatools_a_DEPENDENCIES) ! -rm -f librftatools.a ! $(AR) cru librftatools.a $(librftatools_a_OBJECTS) $(librftatools_a_LIBADD) ! $(RANLIB) librftatools.a mostlyclean-checkPROGRAMS: --- 186,193 ---- maintainer-clean-compile: ! librfta.a: $(librfta_a_OBJECTS) $(librfta_a_DEPENDENCIES) ! -rm -f librfta.a ! $(AR) cru librfta.a $(librfta_a_OBJECTS) $(librfta_a_LIBADD) ! $(RANLIB) librfta.a mostlyclean-checkPROGRAMS: *************** *** 395,398 **** --- 408,412 ---- maintainer-clean-generic clean mostlyclean distclean maintainer-clean + # CodeModelGeneratorTest.cpp\ # Tell versions [3.59,3.63) of GNU make to not export all variables. Index: Makefile.am =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/Makefile.am,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Makefile.am 16 Dec 2002 21:55:41 -0000 1.15 --- Makefile.am 21 Apr 2003 03:02:45 -0000 1.16 *************** *** 1,21 **** INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include ! noinst_LIBRARIES = librftatools.a check_PROGRAMS = UnitTests TESTS = ./UnitTests ! librftatools_a_SOURCES = \ ! IdentifierResolver.cpp\ IdentifierResolverContext.cpp\ IdentifierVisitor.cpp\ LineBasedTextDocument.cpp\ ParserTools.cpp\ PlainTextDocument.cpp\ ! RenameTempRefactoring.cpp\ RefactoringBase.cpp\ RefactoringError.cpp\ ReplaceTextTransform.cpp\ ! SourceBasedTestBase.cpp\ ! SourceLocationRange.cpp\ SourceBuilder.cpp\ SplitTempRefactoring.cpp\ StdAfx.cpp\ TextDocument.cpp\ --- 1,34 ---- INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include ! noinst_LIBRARIES = librfta.a check_PROGRAMS = UnitTests TESTS = ./UnitTests ! librfta_a_SOURCES =\ ! CodeModel.cpp\ ! CodeModelElement.cpp\ ! CodeModelExpressions.cpp\ ! CodeModelStatements.cpp\ ! CodeRewriter.cpp\ IdentifierResolverContext.cpp\ + IdentifierResolver.cpp\ + IdentifierResolverStrategy.cpp\ IdentifierVisitor.cpp\ + IndentLevelManager.cpp\ + InlineTempRefactoring.cpp\ LineBasedTextDocument.cpp\ + MockIdentifierResolverStrategy.cpp\ + MockLineBasedTextDocument.cpp\ + MockTextDocument.cpp\ ParserTools.cpp\ PlainTextDocument.cpp\ ! ReduceTempScopeRefactoring.cpp\ RefactoringBase.cpp\ RefactoringError.cpp\ + RenameTempRefactoring.cpp\ ReplaceTextTransform.cpp\ ! rfta.cpp\ SourceBuilder.cpp\ + SplitDeclarationRefactoring.cpp\ SplitTempRefactoring.cpp\ + StatementsVisitor.cpp\ StdAfx.cpp\ TextDocument.cpp\ *************** *** 23,45 **** TransformList.cpp\ VariableDeclCollector.cpp\ ! VariableDeclVisitor.cpp\ ! rfta.cpp ! UnitTests_SOURCES = \ IdentifierVisitorTest.cpp\ LineBasedTextDocumentTest.cpp\ ! MockLineBasedTextDocument.cpp\ ! MockTextDocument.cpp\ RenameTempRefactoringTest.cpp\ ReplaceTextTransformTest.cpp\ SourceBasedTestBase.cpp\ SplitTempRefactoringTest.cpp\ ToolsBoxTest.cpp\ TransformListTest.cpp\ VariableDeclCollectorTest.cpp\ ! VariableDeclVisitorTest.cpp\ ! UnitTests.cpp\ ! RftaTest.cpp ! ! UnitTests_LDADD = -L$(top_builddir)/lib -lcppunit -ldl\ ! -L../rftaparser -L. -lrftatools -lrfta ! UnitTests_DEPENDENCIES = librftatools.a ../rftaparser/librfta.a \ No newline at end of file --- 36,63 ---- TransformList.cpp\ VariableDeclCollector.cpp\ ! VariableDeclVisitor.cpp ! UnitTests_SOURCES =\ ! UnitTests.cpp\ ! CodeModelGeneratorTest.cpp\ ! CodeWriterInsertTest.cpp\ ! CodeWriterTestBase.cpp\ ! CodeWriterTest.cpp\ ! IdentifierResolverContextTest.cpp\ ! IdentifierResolverTest.cpp\ IdentifierVisitorTest.cpp\ + InlineTempRefactoringTest.cpp\ LineBasedTextDocumentTest.cpp\ ! ReduceTempScopeRefactoringTest.cpp\ RenameTempRefactoringTest.cpp\ ReplaceTextTransformTest.cpp\ + RftaTest.cpp\ SourceBasedTestBase.cpp\ + SplitDeclarationRefactoringTest.cpp\ SplitTempRefactoringTest.cpp\ ToolsBoxTest.cpp\ TransformListTest.cpp\ VariableDeclCollectorTest.cpp\ ! VariableDeclVisitorTest.cpp ! UnitTests_LDADD = -L$(top_builddir)/lib -L../rftaparser -L. -lrfta -lrftaparser -lcppunit -ldl ! UnitTests_DEPENDENCIES = librfta.a ../rftaparser/librftaparser.a ! # CodeModelGeneratorTest.cpp\ |
From: <sve...@us...> - 2003-04-21 03:02:55
|
Update of /cvsroot/cpptool/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv2713 Modified Files: configure.in configure Makefile.in Makefile.am Log Message: updated makefiles Index: configure.in =================================================================== RCS file: /cvsroot/cpptool/rfta/configure.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** configure.in 2 Dec 2002 16:53:55 -0000 1.3 --- configure.in 21 Apr 2003 03:02:47 -0000 1.4 *************** *** 9,12 **** --- 9,13 ---- AC_OUTPUT(Makefile src/Makefile src/rftaparser/Makefile src/rfta/Makefile src/astdumper/Makefile + src/application/Makefile deplib/Makefile deplib/boostcvs/Makefile deplib/boostcvs/libs/Makefile Index: configure =================================================================== RCS file: /cvsroot/cpptool/rfta/configure,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** configure 2 Dec 2002 16:53:55 -0000 1.3 --- configure 21 Apr 2003 03:02:49 -0000 1.4 *************** *** 1348,1351 **** --- 1348,1352 ---- trap 'rm -fr `echo "Makefile src/Makefile src/rftaparser/Makefile src/rfta/Makefile src/astdumper/Makefile + src/application/Makefile deplib/Makefile deplib/boostcvs/Makefile deplib/boostcvs/libs/Makefile *************** *** 1440,1443 **** --- 1441,1445 ---- CONFIG_FILES=\${CONFIG_FILES-"Makefile src/Makefile src/rftaparser/Makefile src/rfta/Makefile src/astdumper/Makefile + src/application/Makefile deplib/Makefile deplib/boostcvs/Makefile deplib/boostcvs/libs/Makefile Index: Makefile.in =================================================================== RCS file: /cvsroot/cpptool/rfta/Makefile.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.in 2 Dec 2002 16:53:56 -0000 1.3 --- Makefile.in 21 Apr 2003 03:02:49 -0000 1.4 *************** *** 65,69 **** VERSION = @VERSION@ ! SUBDIRS = deplib src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs --- 65,69 ---- VERSION = @VERSION@ ! SUBDIRS = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs Index: Makefile.am =================================================================== RCS file: /cvsroot/cpptool/rfta/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.am 2 Dec 2002 16:53:56 -0000 1.2 --- Makefile.am 21 Apr 2003 03:02:49 -0000 1.3 *************** *** 1,2 **** ! SUBDIRS = deplib src --- 1,2 ---- ! SUBDIRS = src |
From: <net...@us...> - 2003-04-16 18:43:06
|
Update of /cvsroot/cpptool/rfta/doc In directory sc8-pr-cvs1:/tmp/cvs-serv4333/doc Modified Files: AbstractSyntaxSTreeStructure.txt Log Message: -- updated documentation for full parser Index: AbstractSyntaxSTreeStructure.txt =================================================================== RCS file: /cvsroot/cpptool/rfta/doc/AbstractSyntaxSTreeStructure.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbstractSyntaxSTreeStructure.txt 15 Apr 2003 19:06:12 -0000 1.6 --- AbstractSyntaxSTreeStructure.txt 16 Apr 2003 18:43:01 -0000 1.7 *************** *** 19,38 **** * tree elements at file level ! [unparsed-namespace] ! ? namespace-body-property => [unparsed-sourcepart] ! ? namespace-alias-property => [#local-scope-identifier] [function-implementation] ! function-header-property => [unparsed-sourcepart] function-body-property => [unparsed-compound-statement] ! [unparsed-template] ! ? template-body-property => [unparsed-sourcepart] ! [unparsed-linkage] ! ? linkage-body-property => [unparsed-sourcepart] ! [using-namespace] ! 1 [#local-scope-identifier] * Statements a function/method body level --- 19,58 ---- * tree elements at file level ! [template-declaration] ! template-header-property => [unparsed-template-header] ! ? template-body-property => [{single-declaration}] ! ! [linkage-declaration] ! linkage-body-property => [{single-declaration}] , [unparsed-declaration-list] ! ! [using-namespace] ! 1 [#local-scope-identifier] ! ! [namespace-alias] ! namespace-alias-property => [#local-scope-identifier] ! namespace-body-property => [unparsed-declaration-list] ! ! [namespace-declaration] ! namespace-body-property => [unparsed-declaration-list] ! 1 [#local-scope-identifier] // namespace name ! ! [declaration-list] ! n [{single-declaration}] [function-implementation] ! function-header-property => [unparsed-function-header] function-body-property => [unparsed-compound-statement] ! [unparsed-declaration-list] ! #mutate: declaration-list ! [unparsed-declaration] ! // mutation not yet defined ! [unparsed-function-header] ! // mutation not yet defined ! ! [unparsed-template-header] ! // mutation not yet defined * Statements a function/method body level |
From: <net...@us...> - 2003-04-15 19:06:40
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv22144/src/rftaparser Modified Files: rftaparser.dsp Log Message: -- moved to declaration list mutator Index: rftaparser.dsp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/rftaparser.dsp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** rftaparser.dsp 14 Apr 2003 19:45:14 -0000 1.34 --- rftaparser.dsp 15 Apr 2003 19:06:37 -0000 1.35 *************** *** 406,414 **** # Begin Source File ! SOURCE=.\UnparsedNamespaceMutator.cpp # End Source File # Begin Source File ! SOURCE=.\UnparsedNamespaceMutator.h # End Source File # Begin Source File --- 406,414 ---- # Begin Source File ! SOURCE=.\UnparsedDeclarationListMutator.cpp # End Source File # Begin Source File ! SOURCE=.\UnparsedDeclarationListMutator.h # End Source File # Begin Source File *************** *** 1045,1053 **** # Begin Source File ! SOURCE=.\UnparsedNamespaceMutatorTest.cpp # End Source File # Begin Source File ! SOURCE=.\UnparsedNamespaceMutatorTest.h # End Source File # Begin Source File --- 1045,1053 ---- # Begin Source File ! SOURCE=.\UnparsedDeclarationListMutatorTest.cpp # End Source File # Begin Source File ! SOURCE=.\UnparsedDeclarationListMutatorTest.h # End Source File # Begin Source File |
From: <net...@us...> - 2003-04-15 19:06:16
|
Update of /cvsroot/cpptool/rfta/doc In directory sc8-pr-cvs1:/tmp/cvs-serv21883/doc Modified Files: AbstractSyntaxSTreeStructure.txt Log Message: -- start documenting new nodes for the full parser Index: AbstractSyntaxSTreeStructure.txt =================================================================== RCS file: /cvsroot/cpptool/rfta/doc/AbstractSyntaxSTreeStructure.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbstractSyntaxSTreeStructure.txt 30 Dec 2002 10:44:32 -0000 1.5 --- AbstractSyntaxSTreeStructure.txt 15 Apr 2003 19:06:12 -0000 1.6 *************** *** 17,23 **** --- 17,45 ---- Tree structure: + * tree elements at file level + + [unparsed-namespace] + ? namespace-body-property => [unparsed-sourcepart] + ? namespace-alias-property => [#local-scope-identifier] + + [function-implementation] + function-header-property => [unparsed-sourcepart] + function-body-property => [unparsed-compound-statement] + + [unparsed-template] + ? template-body-property => [unparsed-sourcepart] + + [unparsed-linkage] + ? linkage-body-property => [unparsed-sourcepart] + + [using-namespace] + 1 [#local-scope-identifier] + * Statements a function/method body level A function/method body is always a node of type compound-statement + + [unparsed-compound-statement] + #mutate: compound-statement [#break-statement] |
From: <net...@us...> - 2003-04-15 19:05:32
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv21347/src/rftaparser Modified Files: ASTNodes.cpp DeclarationListParserTest.cpp DeclarationParser.cpp DeclarationParserTest.cpp LinkageParser.cpp MaxLODMutator.cpp NamespaceParser.cpp TemplateDeclarationParser.cpp Log Message: -- rearrangement of some node types/names and properties Index: ASTNodes.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/ASTNodes.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ASTNodes.cpp 14 Apr 2003 19:33:12 -0000 1.17 --- ASTNodes.cpp 15 Apr 2003 19:05:14 -0000 1.18 *************** *** 13,25 **** const ASTNodeType ASTNodeTypes::source( "source-file", isCompositeStatement ); ! /* AB: NEW */ const ASTNodeType ASTNodeTypes::unparsedSourcePart ( "unparsed-source-part", mayHaveLocalScopeIdentifierChildren ); ! /* AB: NEW */ const ASTNodeType ASTNodeTypes::unparsedTemplate ( "unparsed-template" , mayHaveLocalScopeIdentifierChildren ); ! /* AB: NEW */ const ASTNodeType ASTNodeTypes::unparsedNamespace ( "unparsed-namespace" , mayHaveLocalScopeIdentifierChildren ); ! /* AB: NEW */ const ASTNodeType ASTNodeTypes::unparsedLinkage ( "unparsed-linkage" , 0 ); /* AB: NEW */ const ASTNodeType ASTNodeTypes::usingNamespace ( "using-namespace" , 0 ); /* AB: NEW */ const ASTNodeType ASTNodeTypes::namespaceAlias ( "namespace-alias" , mayHaveLocalScopeIdentifierChildren ); /* AB: NEW */ const ASTNodeType ASTNodeTypes::namespaceDeclaration ( "namespace-declaration" , mayHaveLocalScopeIdentifierChildren ); /* AB: NEW */ const ASTNodeType ASTNodeTypes::declarationList ( "declaration-list" , mayHaveLocalScopeIdentifierChildren ); ! /* AB: NEW */ const ASTNodeType ASTNodeTypes::unparsedfunctionImplementation ( "unparsed-function-implementation" , mayHaveLocalScopeIdentifierChildren ); const ASTNodeType ASTNodeTypes::unparsedCompoundStatement( "unparsed-compound-statement", isCompositeStatement | needMutation ); --- 13,27 ---- const ASTNodeType ASTNodeTypes::source( "source-file", isCompositeStatement ); ! /* AB: NEW */ const ASTNodeType ASTNodeTypes::templateDeclaration ( "template-declaration" , mayHaveLocalScopeIdentifierChildren ); ! /* AB: NEW */ const ASTNodeType ASTNodeTypes::linkageDeclaration ( "linkage-declaration", 0 ); /* AB: NEW */ const ASTNodeType ASTNodeTypes::usingNamespace ( "using-namespace" , 0 ); /* AB: NEW */ const ASTNodeType ASTNodeTypes::namespaceAlias ( "namespace-alias" , mayHaveLocalScopeIdentifierChildren ); /* AB: NEW */ const ASTNodeType ASTNodeTypes::namespaceDeclaration ( "namespace-declaration" , mayHaveLocalScopeIdentifierChildren ); /* AB: NEW */ const ASTNodeType ASTNodeTypes::declarationList ( "declaration-list" , mayHaveLocalScopeIdentifierChildren ); ! /* AB: NEW */ const ASTNodeType ASTNodeTypes::functionImplementation ( "function-implementation" , mayHaveLocalScopeIdentifierChildren ); ! /* AB: NEW */ const ASTNodeType ASTNodeTypes::unparsedDeclarationList ( "unparsed-declaration-list", mayHaveLocalScopeIdentifierChildren ); ! /* AB: NEW */ const ASTNodeType ASTNodeTypes::unparsedDeclaration ( "unparsed-declaration", mayHaveLocalScopeIdentifierChildren ); ! /* AB: NEW */ const ASTNodeType ASTNodeTypes::unparsedFunctionHeader ( "unparsed-function-header", mayHaveLocalScopeIdentifierChildren ); ! /* AB: NEW */ const ASTNodeType ASTNodeTypes::unparsedTemplateHeader ( "unparsed-template-header", mayHaveLocalScopeIdentifierChildren ); const ASTNodeType ASTNodeTypes::unparsedCompoundStatement( "unparsed-compound-statement", isCompositeStatement | needMutation ); *************** *** 94,100 **** --- 96,105 ---- /* AB: NEW */ const ASTNodeProperty ASTNodeProperties::templateBodyProperty( "template-body-property" ); + /* AB: NEW */ const ASTNodeProperty ASTNodeProperties::templateHeaderProperty( "template-header-property" ); /* AB: NEW */ const ASTNodeProperty ASTNodeProperties::linkageBodyProperty( "linkage-body-property" ); /* AB: NEW */ const ASTNodeProperty ASTNodeProperties::namespaceBodyProperty( "namespace-body-property" ); /* AB: NEW */ const ASTNodeProperty ASTNodeProperties::namespaceAliasProperty( "namespace-alias-property" ); + /* AB: NEW */ const ASTNodeProperty ASTNodeProperties::functionBodyProperty( "function-body-property" ); + /* AB: NEW */ const ASTNodeProperty ASTNodeProperties::functionHeaderProperty( "function-header-property" ); } // namespace Refactoring Index: DeclarationListParserTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/DeclarationListParserTest.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DeclarationListParserTest.cpp 14 Apr 2003 19:32:54 -0000 1.2 --- DeclarationListParserTest.cpp 15 Apr 2003 19:05:16 -0000 1.3 *************** *** 8,12 **** #include "DeclarationListParserTest.h" #include <rfta/parser/ASTNodes.h> ! #include "DeclarationListParser.h" --- 8,12 ---- #include "DeclarationListParserTest.h" #include <rfta/parser/ASTNodes.h> ! #include <rfta/parser/DeclarationListParser.h> *************** *** 58,67 **** source.length() ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::unparsedTemplate, startIndex, endIndex-startIndex ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(1), ! ASTNodeTypes::unparsedSourcePart, endIndex+1, 6 ); --- 58,67 ---- source.length() ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::templateDeclaration, startIndex, endIndex-startIndex ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(1), ! ASTNodeTypes::unparsedDeclaration, endIndex+1, 6 ); Index: DeclarationParser.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/DeclarationParser.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DeclarationParser.cpp 14 Apr 2003 19:30:32 -0000 1.2 --- DeclarationParser.cpp 15 Apr 2003 19:05:17 -0000 1.3 *************** *** 45,49 **** ASTNodePtr declarationNode = ! createASTNode( ASTNodeTypes::unparsedSourcePart, getParentNode(), getCurrentIndex(), --- 45,49 ---- ASTNodePtr declarationNode = ! createASTNode( ASTNodeTypes::unparsedDeclaration, getParentNode(), getCurrentIndex(), *************** *** 95,102 **** { current_ = start_of_curl+1; // read until the end of the function body findNextBalanced('{','}'); declarationNode->setLength( getCurrentLength() - start_difference ); ! declarationNode->mutateType(ASTNodeTypes::unparsedfunctionImplementation); return true; } --- 95,122 ---- { current_ = start_of_curl+1; + int bodystartIdx = getCurrentIndex()-1; // read until the end of the function body findNextBalanced('{','}'); + + // store function header in function-header-property + context_.bindNextNodeToProperty(declarationNode,ASTNodeProperties::functionHeaderProperty ); + + ASTNodePtr function_head = + createASTNode( ASTNodeTypes::unparsedFunctionHeader, + declarationNode, + getStartIndex(), bodystartIdx - getStartIndex() ); + context_.addNode(function_head); + + // store function body in function-body-property + context_.bindNextNodeToProperty(declarationNode,ASTNodeProperties::functionBodyProperty ); + + ASTNodePtr function_body = + createASTNode( ASTNodeTypes::unparsedCompoundStatement, + declarationNode, + bodystartIdx, getCurrentIndex() - bodystartIdx ); + context_.addNode(function_body); + declarationNode->setLength( getCurrentLength() - start_difference ); ! declarationNode->mutateType(ASTNodeTypes::functionImplementation); return true; } Index: DeclarationParserTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/DeclarationParserTest.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DeclarationParserTest.cpp 14 Apr 2003 19:31:28 -0000 1.2 --- DeclarationParserTest.cpp 15 Apr 2003 19:05:18 -0000 1.3 *************** *** 51,61 **** ASTNodePtr namespaceDecl = sourceAST->getChildAt(0); RFTA_ASSERT_NODE_HAS( namespaceDecl, ! ASTNodeTypes::unparsedNamespace, startIndex, endIndex-startIndex ); ! RFTA_ASSERT_NODE_HAS( namespaceDecl->getProperty(ASTNodeProperties::namespaceBodyProperty), ! ASTNodeTypes::unparsedSourcePart, ! 14, ! 3 ); } --- 51,63 ---- ASTNodePtr namespaceDecl = sourceAST->getChildAt(0); RFTA_ASSERT_NODE_HAS( namespaceDecl, ! ASTNodeTypes::namespaceDeclaration, startIndex, endIndex-startIndex ); ! RFTA_ASSERT_NODE_PROPERTY_HAS( ! namespaceDecl, ! ASTNodeProperties::namespaceBodyProperty, ! ASTNodeTypes::unparsedDeclarationList, ! 14, ! 3); } *************** *** 73,76 **** --- 75,84 ---- startIndex, endIndex-startIndex ); + RFTA_ASSERT_NODE_PROPERTY_HAS( + sourceAST->getChildAt(0), + ASTNodeProperties::namespaceAliasProperty, + ASTNodeTypes::localScopeIdentifier, + 16, + 1); } *************** *** 132,138 **** source.length()-1 ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::unparsedLinkage, startIndex, endIndex-startIndex ); } --- 140,152 ---- source.length()-1 ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::linkageDeclaration, startIndex, endIndex-startIndex ); + RFTA_ASSERT_NODE_PROPERTY_HAS( + sourceAST->getChildAt(0), + ASTNodeProperties::linkageBodyProperty, + ASTNodeTypes::unparsedDeclarationList, + 16, + 10); } *************** *** 147,151 **** source.length()-1 ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::unparsedLinkage, startIndex, endIndex-startIndex ); --- 161,165 ---- source.length()-1 ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::linkageDeclaration, startIndex, endIndex-startIndex ); *************** *** 162,166 **** source.length()-1 ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::unparsedSourcePart, startIndex, endIndex-startIndex ); --- 176,180 ---- source.length()-1 ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::unparsedDeclaration, startIndex, endIndex-startIndex ); *************** *** 176,183 **** source, source.length()-1 ); ! RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::unparsedfunctionImplementation, startIndex, endIndex-startIndex ); } --- 190,210 ---- source, source.length()-1 ); ! ASTNodePtr fct = sourceAST->getChildAt(0); ! RFTA_ASSERT_NODE_HAS( fct, ! ASTNodeTypes::functionImplementation, startIndex, endIndex-startIndex ); + RFTA_ASSERT_NODE_PROPERTY_HAS( + fct, + ASTNodeProperties::functionBodyProperty, + ASTNodeTypes::unparsedCompoundStatement, + 28, + 7); + RFTA_ASSERT_NODE_PROPERTY_HAS( + fct, + ASTNodeProperties::functionHeaderProperty, + ASTNodeTypes::unparsedFunctionHeader, + 0, + 28); } *************** *** 192,196 **** source.length()-1 ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::unparsedSourcePart, startIndex, endIndex-startIndex ); --- 219,223 ---- source.length()-1 ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::unparsedDeclaration, startIndex, endIndex-startIndex ); *************** *** 200,204 **** DeclarationParserTest::testTemplateClass() { ! const std::string source( " template x< T > class v { T x; }; " ); int startIndex = 1; int endIndex = source.length()-1; --- 227,231 ---- DeclarationParserTest::testTemplateClass() { ! const std::string source( " template < T > class v { T x; }; " ); int startIndex = 1; int endIndex = source.length()-1; *************** *** 207,213 **** source.length()-1 ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::unparsedTemplate, startIndex, endIndex-startIndex ); } --- 234,250 ---- source.length()-1 ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::templateDeclaration, startIndex, endIndex-startIndex ); + RFTA_ASSERT_NODE_PROPERTY_HAS( sourceAST->getChildAt(0), + ASTNodeProperties::templateHeaderProperty, + ASTNodeTypes::unparsedTemplateHeader, + startIndex, + 14 ); + RFTA_ASSERT_NODE_PROPERTY_HAS( sourceAST->getChildAt(0), + ASTNodeProperties::templateBodyProperty, + ASTNodeTypes::unparsedDeclaration, + 16, + endIndex-16 ); } *************** *** 228,234 **** source.length()-1 ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::unparsedTemplate, startIndex, ! endIndex-startIndex ); } --- 265,281 ---- source.length()-1 ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::templateDeclaration, startIndex, ! endIndex-startIndex ); ! RFTA_ASSERT_NODE_PROPERTY_HAS( sourceAST->getChildAt(0), ! ASTNodeProperties::templateHeaderProperty, ! ASTNodeTypes::unparsedTemplateHeader, ! startIndex, ! 33 ); ! RFTA_ASSERT_NODE_PROPERTY_HAS( sourceAST->getChildAt(0), ! ASTNodeProperties::templateBodyProperty, ! ASTNodeTypes::functionImplementation, ! 35, ! source.length()-36 ); } *************** *** 243,247 **** source.length()-1 ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::unparsedTemplate, startIndex, endIndex-startIndex ); --- 290,294 ---- source.length()-1 ); RFTA_ASSERT_NODE_HAS( sourceAST->getChildAt(0), ! ASTNodeTypes::templateDeclaration, startIndex, endIndex-startIndex ); Index: LinkageParser.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/LinkageParser.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LinkageParser.cpp 14 Apr 2003 19:29:27 -0000 1.2 --- LinkageParser.cpp 15 Apr 2003 19:05:18 -0000 1.3 *************** *** 36,40 **** ASTNodePtr linkageNode = ! createASTNode( ASTNodeTypes::unparsedLinkage, getParentNode(), getStartIndex(), --- 36,40 ---- ASTNodePtr linkageNode = ! createASTNode( ASTNodeTypes::linkageDeclaration, getParentNode(), getStartIndex(), *************** *** 51,54 **** --- 51,60 ---- skipSpaces(); + + // setup the context to bind next node to templatebody-property + context_.bindNextNodeToProperty( linkageNode, + ASTNodeProperties::linkageBodyProperty ); + + int bodystartIdx = getCurrentIndex(); // check for surrounding linkage: if (tryNextIs('{')) *************** *** 56,67 **** // is surrounding linkage like: "extern "C" { ... }" findNextBalanced('{','}'); } else { // is single linkage like: extern "C" ... - - // setup the context to bind next node to templatebody-property - context_.bindNextNodeToProperty( linkageNode, - ASTNodeProperties::linkageBodyProperty ); - DeclarationParser parser( context_, current_, end_ ); parser.tryParse(); --- 62,75 ---- // is surrounding linkage like: "extern "C" { ... }" findNextBalanced('{','}'); + + ASTNodePtr linkageBody = + createASTNode( ASTNodeTypes::unparsedDeclarationList, + getParentNode(), + bodystartIdx+1, + getCurrentIndex()-bodystartIdx-2 ); + context_.addNode( linkageBody ); } else { // is single linkage like: extern "C" ... DeclarationParser parser( context_, current_, end_ ); parser.tryParse(); Index: MaxLODMutator.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/MaxLODMutator.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MaxLODMutator.cpp 14 Apr 2003 19:46:29 -0000 1.9 --- MaxLODMutator.cpp 15 Apr 2003 19:05:18 -0000 1.10 *************** *** 9,13 **** #include "ExpressionIdentifierMutator.h" #include "UnparsedCompoundMutator.h" ! #include "UnparsedNamespaceMutator.h" #include <rfta/parser/ASTNodes.h> #include <rfta/parser/MaxLODMutator.h> --- 9,13 ---- #include "ExpressionIdentifierMutator.h" #include "UnparsedCompoundMutator.h" ! #include "UnparsedDeclarationListMutator.h" #include <rfta/parser/ASTNodes.h> #include <rfta/parser/MaxLODMutator.h> *************** *** 75,80 **** add( ASTNodeTypes::constantExpression, *new ExpressionIdentifierMutator() ); ! add( ASTNodeTypes::unparsedNamespace, ! *new UnparsedNamespaceMutator() ); } --- 75,80 ---- add( ASTNodeTypes::constantExpression, *new ExpressionIdentifierMutator() ); ! add( ASTNodeTypes::unparsedDeclarationList, ! *new UnparsedDeclarationListMutator() ); } Index: NamespaceParser.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/NamespaceParser.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NamespaceParser.cpp 14 Apr 2003 19:28:54 -0000 1.2 --- NamespaceParser.cpp 15 Apr 2003 19:05:19 -0000 1.3 *************** *** 35,39 **** ASTNodePtr namespaceNode = ! createASTNode( ASTNodeTypes::unparsedNamespace, getParentNode(), getStartIndex(), --- 35,39 ---- ASTNodePtr namespaceNode = ! createASTNode( ASTNodeTypes::namespaceDeclaration, getParentNode(), getStartIndex(), *************** *** 79,83 **** createASTNode( ASTNodeTypes::localScopeIdentifier, namespaceNode, ! alias_startIdx, getCurrentIndex() - alias_startIdx + 1 ); context_.addNode(namespace_identifier); --- 79,83 ---- createASTNode( ASTNodeTypes::localScopeIdentifier, namespaceNode, ! alias_startIdx, getCurrentIndex() - alias_startIdx ); context_.addNode(namespace_identifier); *************** *** 96,100 **** ASTNodePtr namespace_body = ! createASTNode( ASTNodeTypes::unparsedSourcePart, namespaceNode, body_startIdx, getCurrentIndex() - body_startIdx ); --- 96,100 ---- ASTNodePtr namespace_body = ! createASTNode( ASTNodeTypes::unparsedDeclarationList, namespaceNode, body_startIdx, getCurrentIndex() - body_startIdx ); Index: TemplateDeclarationParser.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/TemplateDeclarationParser.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TemplateDeclarationParser.cpp 14 Apr 2003 19:28:00 -0000 1.2 --- TemplateDeclarationParser.cpp 15 Apr 2003 19:05:19 -0000 1.3 *************** *** 36,40 **** ASTNodePtr templateNode = ! createASTNode( ASTNodeTypes::unparsedTemplate, getParentNode(), getStartIndex(), --- 36,40 ---- ASTNodePtr templateNode = ! createASTNode( ASTNodeTypes::templateDeclaration, getParentNode(), getStartIndex(), *************** *** 47,53 **** // read the template parameter if (tryNextIs('<')) ! { // skipping all the parameters until next '>' ! findNextBalanced('<','>'); } skipSpaces(); --- 47,62 ---- // read the template parameter if (tryNextIs('<')) ! { // skipping all the parameters until next '>' ! findNextBalanced('<','>'); ! // setup the context to bind next node to template-header-property ! context_.bindNextNodeToProperty( templateNode, ! ASTNodeProperties::templateHeaderProperty ); ! ASTNodePtr templateHeader = ! createASTNode( ASTNodeTypes::unparsedTemplateHeader, ! getParentNode(), ! getStartIndex(), ! getCurrentLength() ); ! context_.addNode( templateHeader ); } skipSpaces(); |
From: <net...@us...> - 2003-04-15 19:05:24
|
Update of /cvsroot/cpptool/rfta/include/rfta/parser In directory sc8-pr-cvs1:/tmp/cvs-serv21347/include/rfta/parser Modified Files: ASTNodes.h Log Message: -- rearrangement of some node types/names and properties Index: ASTNodes.h =================================================================== RCS file: /cvsroot/cpptool/rfta/include/rfta/parser/ASTNodes.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ASTNodes.h 14 Apr 2003 19:33:14 -0000 1.15 --- ASTNodes.h 15 Apr 2003 19:05:20 -0000 1.16 *************** *** 20,34 **** static const ASTNodeType source; ! // a part of a source file that has not yet been parsed ! static const ASTNodeType unparsedSourcePart; ! ! // a template declaration that has not yet been parsed ! static const ASTNodeType unparsedTemplate; ! // a namespace-area that has not yet been parsed ! static const ASTNodeType unparsedNamespace; // a linkage declaration e.g. 'extern "C++" { }' ! static const ASTNodeType unparsedLinkage; // the command declaring the use of a namespace "using namespace xxx;" --- 20,40 ---- static const ASTNodeType source; ! // a list of declarations that have not yet been parsed ! static const ASTNodeType unparsedDeclarationList; ! ! // a declaration that has not yet been parsed ! static const ASTNodeType unparsedDeclaration; ! ! // a function header that has not yet been parsed ! static const ASTNodeType unparsedFunctionHeader; ! // a template declaration ! static const ASTNodeType templateDeclaration; + // a template header that has not yet been parsed. + static const ASTNodeType unparsedTemplateHeader; + // a linkage declaration e.g. 'extern "C++" { }' ! static const ASTNodeType linkageDeclaration; // the command declaring the use of a namespace "using namespace xxx;" *************** *** 44,50 **** static const ASTNodeType declarationList; ! // a not parsed function/method implementation // e.g. "int fct() { ... }" ! static const ASTNodeType unparsedfunctionImplementation; // statement types --- 50,56 ---- static const ASTNodeType declarationList; ! // a function/method implementation // e.g. "int fct() { ... }" ! static const ASTNodeType functionImplementation; // statement types *************** *** 201,206 **** --- 207,216 ---- static const ASTNodeProperty namespaceBodyProperty; static const ASTNodeProperty namespaceAliasProperty; + static const ASTNodeProperty templateHeaderProperty; static const ASTNodeProperty templateBodyProperty; static const ASTNodeProperty linkageBodyProperty; + static const ASTNodeProperty functionBodyProperty; + static const ASTNodeProperty functionHeaderProperty; + }; |
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv20892/src/rftaparser Added Files: UnparsedDeclarationListMutator.cpp UnparsedDeclarationListMutator.h UnparsedDeclarationListMutatorTest.cpp UnparsedDeclarationListMutatorTest.h Log Message: -- moved to declaration list mutator --- NEW FILE: UnparsedDeclarationListMutator.cpp --- // ////////////////////////////////////////////////////////////////////////// // Implementation file UnparsedDeclarationListMutator.cpp for class UnparsedDeclarationListMutator // (c)Copyright 2003, Andre Baresel. // Created: 2003/04/14 // ////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "UnparsedDeclarationListMutator.h" #include <rfta/parser/ASTNodes.h> #include <rfta/parser/ParseContext.h> #include <rfta/parser/DeclarationListParser.h> namespace Refactoring { UnparsedDeclarationListMutator::UnparsedDeclarationListMutator() { } UnparsedDeclarationListMutator::~UnparsedDeclarationListMutator() { } void UnparsedDeclarationListMutator::mutate( const ASTNodePtr &node, const SourceASTNodePtr &sourceNode ) const { ParseContext context( sourceNode ); const char *start = sourceNode->getBlankedSourceStart() + node->getStartIndex(); const char *end = start + node->getLength(); ++start; --end; ParseContext::ParentNodePusher pusher( node, context ); DeclarationListParser parser( context, start, end ); if ( parser.tryParse() ) { node->mutateType( ASTNodeTypes::declarationList ); } } } // namespace Refactoring --- NEW FILE: UnparsedDeclarationListMutator.h --- // ////////////////////////////////////////////////////////////////////////// // Header file UnparsedDeclarationListMutator.h for class UnparsedDeclarationListMutator // (c)Copyright 2003, Andre Baresel. // Created: 2003/04/14 // ////////////////////////////////////////////////////////////////////////// #ifndef RFTA_UnparsedDeclarationListMutator_H #define RFTA_UnparsedDeclarationListMutator_H #include <rfta/parser/Mutator.h> #include <boost/utility.hpp> namespace Refactoring { /// Mutate an unparsed-declaration-list into a parsed declaration-list class UnparsedDeclarationListMutator : public Mutator , public boost::noncopyable { public: /*! Constructs a UnparsedDeclarationListMutator object. */ UnparsedDeclarationListMutator(); /// Destructor. virtual ~UnparsedDeclarationListMutator(); void mutate( const ASTNodePtr &node, const SourceASTNodePtr &sourceNode ) const; }; // Inlines methods for UnparsedDeclarationListMutator: // -------------------------------------------- } // namespace Refactoring #endif // RFTA_UnparsedDeclarationListMutator_H --- NEW FILE: UnparsedDeclarationListMutatorTest.cpp --- // ////////////////////////////////////////////////////////////////////////// // Implementation file UnparsedDeclarationListMutatorTest.cpp for class UnparsedDeclarationListMutatorTest // (c)Copyright 2003, Andre Baresel. // Created: 2003/04/14 // ////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "UnparsedDeclarationListMutator.h" #include "NamespaceParser.h" #include "UnparsedDeclarationListMutatorTest.h" #include <rfta/parser/ASTNode.h> #include <rfta/parser/ASTNodes.h> #include <rfta/parser/ParseContext.h> #include <rfta/parser/SourceASTNode.h> namespace Refactoring { RFTAPARSER_TEST_SUITE_REGISTRATION( UnparsedDeclarationListMutatorTest ); UnparsedDeclarationListMutatorTest::UnparsedDeclarationListMutatorTest() : CppUnit::TestFixture() { } UnparsedDeclarationListMutatorTest::~UnparsedDeclarationListMutatorTest() { } void UnparsedDeclarationListMutatorTest::setUp() { } void UnparsedDeclarationListMutatorTest::tearDown() { } void UnparsedDeclarationListMutatorTest::testMutate() { /* precreate a AST with a unparsed declaration list: */ const std::string source( "namespace y { int x; float (*f)(int x); } " ); SourceASTNodePtr sourceNode = SourceASTNode::create( source, source ); ParseContext context(sourceNode); NamespaceParser parser(context, sourceNode->getBlankedSourceStart(), sourceNode->getBlankedSourceEnd()); parser.parse(); ASTNodePtr namespaceNode = sourceNode->getChildAt(0); // check precondition for test: RFTA_ASSERT_NODE_HAS( namespaceNode->getProperty(ASTNodeProperties::namespaceBodyProperty), ASTNodeTypes::unparsedDeclarationList, 12, 29 ); ASTNodePtr namespaceBody = namespaceNode->getProperty(ASTNodeProperties::namespaceBodyProperty); // execute mutator test: UnparsedDeclarationListMutator mutator; mutator.mutate( namespaceBody, sourceNode ); // check post condition: RFTA_ASSERT_NODE_PROPERTY_HAS( namespaceNode, ASTNodeProperties::namespaceBodyProperty, ASTNodeTypes::declarationList, 12, 29); RFTA_ASSERT_EQUAL( 2, namespaceNode->getProperty(ASTNodeProperties::namespaceBodyProperty)->getChildCount() ); } } // namespace Refactoring --- NEW FILE: UnparsedDeclarationListMutatorTest.h --- // ////////////////////////////////////////////////////////////////////////// // Header file UnparsedDeclarationListMutatorTest.h for class UnparsedDeclarationListMutatorTest // (c)Copyright 2003, Andre Baresel. // Created: 2003/04/14 // ////////////////////////////////////////////////////////////////////////// #ifndef RFTA_UnparsedDeclarationListMutatorTest_H #define RFTA_UnparsedDeclarationListMutatorTest_H #include "ParserTesting.h" namespace Refactoring { /// Unit tests for UnparsedDeclarationListMutatorTest class UnparsedDeclarationListMutatorTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE( UnparsedDeclarationListMutatorTest ); CPPUNIT_TEST( testMutate ); CPPUNIT_TEST_SUITE_END(); public: /*! Constructs a UnparsedDeclarationListMutatorTest object. */ UnparsedDeclarationListMutatorTest(); /// Destructor. virtual ~UnparsedDeclarationListMutatorTest(); void setUp(); void tearDown(); void testMutate(); private: /// Prevents the use of the copy constructor. UnparsedDeclarationListMutatorTest( const UnparsedDeclarationListMutatorTest &other ); /// Prevents the use of the copy operator. void operator =( const UnparsedDeclarationListMutatorTest &other ); private: }; // Inlines methods for UnparsedDeclarationListMutatorTest: // ------------------------------------------------ } // namespace Refactoring #endif // RFTA_UnparsedDeclarationListMutatorTest_H |
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv20194/src/rftaparser Removed Files: UnparsedNamespaceMutator.cpp UnparsedNamespaceMutator.h UnparsedNamespaceMutatorTest.cpp UnparsedNamespaceMutatorTest.h Log Message: -- moved to declaration list mutator --- UnparsedNamespaceMutator.cpp DELETED --- --- UnparsedNamespaceMutator.h DELETED --- --- UnparsedNamespaceMutatorTest.cpp DELETED --- --- UnparsedNamespaceMutatorTest.h DELETED --- |
From: <net...@us...> - 2003-04-14 19:48:03
|
Update of /cvsroot/cpptool/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv1633 Modified Files: .cvsignore Log Message: -- ignore some more temp files Index: .cvsignore =================================================================== RCS file: /cvsroot/cpptool/rfta/.cvsignore,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** .cvsignore 23 Oct 2002 20:22:40 -0000 1.1.1.1 --- .cvsignore 14 Apr 2003 19:47:59 -0000 1.2 *************** *** 1 **** --- 1,2 ---- build + *.plg \ No newline at end of file |
From: <net...@us...> - 2003-04-14 19:47:51
|
Update of /cvsroot/cpptool/rfta/deplib/cppunit In directory sc8-pr-cvs1:/tmp/cvs-serv1525/deplib/cppunit Added Files: .cvsignore Log Message: -- ignore some more temp files --- NEW FILE: .cvsignore --- build lib *.plg |
From: <net...@us...> - 2003-04-14 19:47:26
|
Update of /cvsroot/cpptool/rfta/deplib/cppunit/src/DllPlugInTester In directory sc8-pr-cvs1:/tmp/cvs-serv1311/deplib/cppunit/src/DllPlugInTester Modified Files: .cvsignore Log Message: -- ignore some more temp files Index: .cvsignore =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/cppunit/src/DllPlugInTester/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 23 Oct 2002 22:16:42 -0000 1.1 --- .cvsignore 14 Apr 2003 19:47:23 -0000 1.2 *************** *** 1 **** --- 1,3 ---- *.WW + DebugDll + ReleaseDll \ No newline at end of file |
From: <net...@us...> - 2003-04-14 19:47:12
|
Update of /cvsroot/cpptool/rfta/deplib/cppunit/src/cppunit In directory sc8-pr-cvs1:/tmp/cvs-serv1197/deplib/cppunit/src/cppunit Modified Files: .cvsignore Log Message: -- ignore some more temp files Index: .cvsignore =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/cppunit/src/cppunit/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 23 Oct 2002 22:16:42 -0000 1.1 --- .cvsignore 14 Apr 2003 19:47:08 -0000 1.2 *************** *** 1 **** --- 1,4 ---- *.WW + DebugDll + ReleaseDll + |
From: <net...@us...> - 2003-04-14 19:46:37
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv915/src/rftaparser Modified Files: MaxLODMutator.cpp Log Message: -- namespace mutator added Index: MaxLODMutator.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/MaxLODMutator.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MaxLODMutator.cpp 20 Dec 2002 19:37:54 -0000 1.8 --- MaxLODMutator.cpp 14 Apr 2003 19:46:29 -0000 1.9 *************** *** 9,12 **** --- 9,13 ---- #include "ExpressionIdentifierMutator.h" #include "UnparsedCompoundMutator.h" + #include "UnparsedNamespaceMutator.h" #include <rfta/parser/ASTNodes.h> #include <rfta/parser/MaxLODMutator.h> *************** *** 74,77 **** --- 75,80 ---- add( ASTNodeTypes::constantExpression, *new ExpressionIdentifierMutator() ); + add( ASTNodeTypes::unparsedNamespace, + *new UnparsedNamespaceMutator() ); } |
From: <net...@us...> - 2003-04-14 19:46:15
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv803/src/rftaparser Modified Files: DeclarationListParser.cpp Log Message: -- moved to different directory Index: DeclarationListParser.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/DeclarationListParser.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DeclarationListParser.cpp 14 Apr 2003 19:32:04 -0000 1.2 --- DeclarationListParser.cpp 14 Apr 2003 19:46:11 -0000 1.3 *************** *** 8,12 **** #include <rfta/parser/ASTNodes.h> #include <rfta/parser/DeclarationParser.h> ! #include "DeclarationListParser.h" #include <rfta/parser/ParseContext.h> #include <stdexcept> --- 8,12 ---- #include <rfta/parser/ASTNodes.h> #include <rfta/parser/DeclarationParser.h> ! #include <rfta/parser/DeclarationListParser.h> #include <rfta/parser/ParseContext.h> #include <stdexcept> |
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv426/src/rftaparser Modified Files: rftaparser.dsp Added Files: UnparsedNamespaceMutator.cpp UnparsedNamespaceMutator.h UnparsedNamespaceMutatorTest.cpp UnparsedNamespaceMutatorTest.h Log Message: -- namespace mutator added --- NEW FILE: UnparsedNamespaceMutator.cpp --- // ////////////////////////////////////////////////////////////////////////// // Implementation file UnparsedNamespaceMutator.cpp for class UnparsedNamespaceMutator // (c)Copyright 2003, Andre Baresel. // Created: 2003/04/14 // ////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "UnparsedNamespaceMutator.h" #include <rfta/parser/ASTNodes.h> #include <rfta/parser/ParseContext.h> #include "DeclarationListParser.h" namespace Refactoring { UnparsedNamespaceMutator::UnparsedNamespaceMutator() { } UnparsedNamespaceMutator::~UnparsedNamespaceMutator() { } void UnparsedNamespaceMutator::mutate( const ASTNodePtr &node, const SourceASTNodePtr &sourceNode ) const { if ( node->hasProperty(ASTNodeProperties::namespaceBodyProperty ) ) { ASTNodePtr body = node->getProperty(ASTNodeProperties::namespaceBodyProperty); ParseContext context( sourceNode ); const char *start = sourceNode->getBlankedSourceStart() + body->getStartIndex(); const char *end = start + body->getLength(); ++start; --end; ParseContext::ParentNodePusher pusher( body, context ); DeclarationListParser parser( context, start, end ); if ( parser.tryParse() ) { node->mutateType( ASTNodeTypes::namespaceDeclaration ); body->mutateType( ASTNodeTypes::declarationList ); } } } } // namespace Refactoring --- NEW FILE: UnparsedNamespaceMutator.h --- // ////////////////////////////////////////////////////////////////////////// // Header file UnparsedNamespaceMutator.h for class UnparsedNamespaceMutator // (c)Copyright 2003, Andre Baresel. // Created: 2003/04/14 // ////////////////////////////////////////////////////////////////////////// #ifndef RFTA_UnparsedNamespaceMutator_H #define RFTA_UnparsedNamespaceMutator_H #include <rfta/parser/Mutator.h> #include <boost/utility.hpp> namespace Refactoring { /// Mutate an unparsed-namespace into a namespace with parsed body. class UnparsedNamespaceMutator : public Mutator , public boost::noncopyable { public: /*! Constructs a UnparsedNamespaceMutator object. */ UnparsedNamespaceMutator(); /// Destructor. virtual ~UnparsedNamespaceMutator(); void mutate( const ASTNodePtr &node, const SourceASTNodePtr &sourceNode ) const; }; // Inlines methods for UnparsedNamespaceMutator: // -------------------------------------------- } // namespace Refactoring #endif // RFTA_UnparsedNamespaceMutator_H --- NEW FILE: UnparsedNamespaceMutatorTest.cpp --- // ////////////////////////////////////////////////////////////////////////// // Implementation file UnparsedNamespaceMutatorTest.cpp for class UnparsedNamespaceMutatorTest // (c)Copyright 2003, Andre Baresel. // Created: 2003/04/14 // ////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "UnparsedNamespaceMutator.h" #include "NamespaceParser.h" #include "UnparsedNamespaceMutatorTest.h" #include <rfta/parser/ASTNode.h> #include <rfta/parser/ASTNodes.h> #include <rfta/parser/ParseContext.h> #include <rfta/parser/SourceASTNode.h> namespace Refactoring { RFTAPARSER_TEST_SUITE_REGISTRATION( UnparsedNamespaceMutatorTest ); UnparsedNamespaceMutatorTest::UnparsedNamespaceMutatorTest() : CppUnit::TestFixture() { } UnparsedNamespaceMutatorTest::~UnparsedNamespaceMutatorTest() { } void UnparsedNamespaceMutatorTest::setUp() { } void UnparsedNamespaceMutatorTest::tearDown() { } void UnparsedNamespaceMutatorTest::testMutate() { const std::string source( "namespace y { int x; float (*f)(int x); } " ); SourceASTNodePtr sourceNode = SourceASTNode::create( source, source ); /* ASTNodePtr namespaceNode = ASTNode::create( ASTNodeTypes::unparsedNamespace, sourceNode, startIndex, length, sourceNode ); */ ParseContext context(sourceNode); NamespaceParser parser(context, sourceNode->getBlankedSourceStart(), sourceNode->getBlankedSourceEnd()); parser.parse(); ASTNodePtr namespaceNode = sourceNode->getChildAt(0); UnparsedNamespaceMutator mutator; mutator.mutate( namespaceNode, sourceNode ); RFTA_ASSERT_NODE_HAS( namespaceNode, ASTNodeTypes::namespaceDeclaration, 0, source.length()-2 ); RFTA_ASSERT_NODE_PROPERTY_HAS( namespaceNode, ASTNodeProperties::namespaceBodyProperty, ASTNodeTypes::declarationList, 12, 29); RFTA_ASSERT_EQUAL( 2, namespaceNode->getProperty(ASTNodeProperties::namespaceBodyProperty)->getChildCount() ); } } // namespace Refactoring --- NEW FILE: UnparsedNamespaceMutatorTest.h --- // ////////////////////////////////////////////////////////////////////////// // Header file UnparsedNamespaceMutatorTest.h for class UnparsedNamespaceMutatorTest // (c)Copyright 2003, Andre Baresel. // Created: 2003/04/14 // ////////////////////////////////////////////////////////////////////////// #ifndef RFTA_UnparsedNamespaceMutatorTest_H #define RFTA_UnparsedNamespaceMutatorTest_H #include "ParserTesting.h" namespace Refactoring { /// Unit tests for UnparsedNamespaceMutatorTest class UnparsedNamespaceMutatorTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE( UnparsedNamespaceMutatorTest ); CPPUNIT_TEST( testMutate ); CPPUNIT_TEST_SUITE_END(); public: /*! Constructs a UnparsedNamespaceMutatorTest object. */ UnparsedNamespaceMutatorTest(); /// Destructor. virtual ~UnparsedNamespaceMutatorTest(); void setUp(); void tearDown(); void testMutate(); private: /// Prevents the use of the copy constructor. UnparsedNamespaceMutatorTest( const UnparsedNamespaceMutatorTest &other ); /// Prevents the use of the copy operator. void operator =( const UnparsedNamespaceMutatorTest &other ); private: }; // Inlines methods for UnparsedNamespaceMutatorTest: // ------------------------------------------------ } // namespace Refactoring #endif // RFTA_UnparsedNamespaceMutatorTest_H Index: rftaparser.dsp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/rftaparser.dsp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** rftaparser.dsp 12 Apr 2003 19:07:07 -0000 1.33 --- rftaparser.dsp 14 Apr 2003 19:45:14 -0000 1.34 *************** *** 166,170 **** # Begin Source File ! SOURCE=.\DeclarationListParser.h # End Source File # Begin Source File --- 166,170 ---- # Begin Source File ! SOURCE=..\..\include\rfta\parser\DeclarationListParser.h # End Source File # Begin Source File *************** *** 182,186 **** # Begin Source File ! SOURCE=.\DeclarationParser.h # End Source File # Begin Source File --- 182,186 ---- # Begin Source File ! SOURCE=..\..\include\rfta\parser\DeclarationParser.h # End Source File # Begin Source File *************** *** 406,409 **** --- 406,417 ---- # Begin Source File + SOURCE=.\UnparsedNamespaceMutator.cpp + # End Source File + # Begin Source File + + SOURCE=.\UnparsedNamespaceMutator.h + # End Source File + # Begin Source File + SOURCE=.\VariableDeclMutator.cpp # End Source File *************** *** 1034,1037 **** --- 1042,1053 ---- !ENDIF + # End Source File + # Begin Source File + + SOURCE=.\UnparsedNamespaceMutatorTest.cpp + # End Source File + # Begin Source File + + SOURCE=.\UnparsedNamespaceMutatorTest.h # End Source File # Begin Source File |
From: <net...@us...> - 2003-04-14 19:42:58
|
Update of /cvsroot/cpptool/rfta/include/rfta/parser In directory sc8-pr-cvs1:/tmp/cvs-serv31633 Added Files: DeclarationListParser.h Log Message: -- moved to different directory --- NEW FILE: DeclarationListParser.h --- // ////////////////////////////////////////////////////////////////////////// // Header file DeclarationListParser.h for class DeclarationListParser // (c)Copyright 2003, Andre Baresel. // Created: 2003/04/10 // ////////////////////////////////////////////////////////////////////////// #ifndef RFTA_DeclarationListParser_H #define RFTA_DeclarationListParser_H #include <rfta/parser/Parser.h> namespace Refactoring { /// declaration list parser: { ... }. class RFTAPARSER_API DeclarationListParser : public Parser { public: /*! Constructs a DeclarationListParser object. */ DeclarationListParser( ParseContext &context, const char *start, const char *end ); /// Destructor. virtual ~DeclarationListParser(); bool tryParse(); }; // Inlines methods for DeclarationListParser: // -------------------------------------------- } // namespace Refactoring #endif // RFTA_DeclarationListParser_H |
From: <net...@us...> - 2003-04-14 19:42:02
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv31133 Removed Files: DeclarationListParser.h Log Message: -- moved to different directory --- DeclarationListParser.h DELETED --- |