From: <sve...@us...> - 2003-04-21 16:10:32
|
Update of /cvsroot/cpptool/rfta/include/rfta/refactoring In directory sc8-pr-cvs1:/tmp/cvs-serv20797/include/rfta/refactoring Added Files: SplitDeclarationRefactoring.h Log Message: initial check-in Takes a declaration like int *x, &y, z=5; and splits it into int *x; int &y; int z=5; Implemented using the code model component --- NEW FILE: SplitDeclarationRefactoring.h --- // ////////////////////////////////////////////////////////////////////////// // Header file SplitDeclarationRefactoring.h for class SplitDeclarationRefactoring // (c)Copyright 2002, Sven Reichard. // Created: 2002/12/05 // ////////////////////////////////////////////////////////////////////////// #ifndef RFTA_SPLITDECLARATIONREFACTORING_H #define RFTA_SPLITDECLARATIONREFACTORING_H #include "ToolsBox.h" #include <boost/utility.hpp> #include <rfta/parser/ASTNode.h> #include <rfta/parser/SourceRange.h> #include <rfta/refactoring/RefactoringBase.h> # include <rfta/refactoring/CodeModelForward.h> namespace Refactoring { class SourceRange; class TextDocument; /// SplitDeclaration refactoring. class RFTA_API SplitDeclarationRefactoring : public RefactoringBase { public: /*! Constructs a SplitDeclarationRefactoring object. */ SplitDeclarationRefactoring( TextDocument &document, int declarationLocation ); /// Destructor. virtual ~SplitDeclarationRefactoring(); void apply( ); private: void prepare(); int findIndexOfCorrectDeclaration( CodeModel::CompoundStatementPtr ); CodeModel::StatementPtr makeDeclarationFromFirstDeclarator( const CodeModel::DeclaratorExpressionPtr); private: int declarationLocation_; SourceASTNodePtr sourceNode_; }; // Inlines methods for SplitDeclarationRefactoring: // ------------------------------------------ } // namespace Refactoring #endif // RFTA_SPLITDECLARATIONREFACTORING_H |