|
From: <bl...@us...> - 2003-04-05 18:29:30
|
Update of /cvsroot/cpptool/rfta/include/rfta/refactoring
In directory sc8-pr-cvs1:/tmp/cvs-serv28468/include/rfta/refactoring
Modified Files:
CodeModelElement.h CodeModelForward.h CodeModelStatements.h
CodeModelVisitor.h
Log Message:
* added working python binding for code model statement
Index: CodeModelElement.h
===================================================================
RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/CodeModelElement.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** CodeModelElement.h 1 Apr 2003 08:29:48 -0000 1.12
--- CodeModelElement.h 5 Apr 2003 18:28:57 -0000 1.13
***************
*** 9,12 ****
--- 9,14 ----
#include <rfta/parser/SourceRange.h>
#include <rfta/parser/ASTNodeForward.h>
+ #include <boost/enable_shared_from_this.hpp>
+ #include <boost/utility.hpp>
#include <stdexcept>
***************
*** 16,20 ****
/// This class represents
! class RFTA_API Element
{
public:
--- 18,23 ----
/// This class represents
! class RFTA_API Element : public boost::enable_shared_from_this<Element>
! , public boost::noncopyable
{
public:
***************
*** 41,44 ****
--- 44,54 ----
virtual void accept( ElementVisitor &visitor );
+
+ protected:
+ template<typename ThisType>
+ boost::shared_ptr<ThisType> makeSharedFromThis( ThisType *thisPointer )
+ {
+ return boost::static_pointer_cast<ThisType>( shared_from_this() );
+ }
private:
Index: CodeModelForward.h
===================================================================
RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/CodeModelForward.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** CodeModelForward.h 24 Mar 2003 07:57:49 -0000 1.11
--- CodeModelForward.h 5 Apr 2003 18:28:57 -0000 1.12
***************
*** 8,12 ****
#include <rfta/refactoring/Config.h>
#include <boost/shared_ptr.hpp>
- #include <boost/weak_ptr.hpp>
namespace Refactoring { namespace CodeModel {
--- 8,11 ----
***************
*** 20,24 ****
class CaseStatement;
class CompoundStatement;
- class ConditionStatement;
class ContinueStatement;
class DeclarationStatement;
--- 19,22 ----
***************
*** 26,39 ****
class DoStatement;
class ExpressionStatement;
- class FlowControlStatement;
class ForStatement;
class GotoStatement;
class IfStatement;
- class IterationStatement;
class LabelStatement;
class NullStatement;
class ReturnStatement;
class Statement;
- class SwitchLabelStatement;
class SwitchStatement;
class WhileStatement;
--- 24,34 ----
***************
*** 52,55 ****
--- 47,70 ----
class ElementVisitor;
+
+ typedef boost::shared_ptr<BreakStatement> BreakStatementPtr;
+ typedef boost::shared_ptr<CaseStatement> CaseStatementPtr;
+ typedef boost::shared_ptr<CompoundStatement> CompoundStatementPtr;
+ typedef boost::shared_ptr<ContinueStatement> ContinueStatementPtr;
+ typedef boost::shared_ptr<DeclarationStatement> DeclarationStatementPtr;
+ typedef boost::shared_ptr<DefaultStatement> DefaultStatementPtr;
+ typedef boost::shared_ptr<DoStatement> DoStatementPtr;
+ typedef boost::shared_ptr<ExpressionStatement> ExpressionStatementPtr;
+ typedef boost::shared_ptr<ForStatement> ForStatementPtr;
+ typedef boost::shared_ptr<GotoStatement> GotoStatementPtr;
+ typedef boost::shared_ptr<IfStatement> IfStatementPtr;
+ typedef boost::shared_ptr<LabelStatement> LabelStatementPtr;
+ typedef boost::shared_ptr<NullStatement> NullStatementPtr;
+ typedef boost::shared_ptr<ReturnStatement> ReturnStatementPtr;
+ typedef boost::shared_ptr<Statement> StatementPtr;
+ typedef boost::shared_ptr<SwitchStatement> SwitchStatementPtr;
+ typedef boost::shared_ptr<WhileStatement> WhileStatementPtr;
+
+
typedef boost::shared_ptr<Element> ElementPtr;
typedef boost::shared_ptr<Label> LabelPtr;
***************
*** 57,68 ****
typedef boost::shared_ptr<DeclaratorExpression> DeclaratorExpressionPtr;
typedef boost::shared_ptr<Expression> ExpressionPtr;
- typedef boost::shared_ptr<DoStatement> DoStatementPtr;
- typedef boost::shared_ptr<WhileStatement> WhileStatementPtr;
- typedef boost::shared_ptr<ForStatement> ForStatementPtr;
- typedef boost::weak_ptr<Expression> ExpressionWeakPtr;
- typedef boost::shared_ptr<CompoundStatement> CompoundStatementPtr;
- typedef boost::shared_ptr<Statement> StatementPtr;
- typedef boost::weak_ptr<Statement> StatementWeakPtr;
- typedef boost::shared_ptr<DeclaratorExpression> DeclaratorExpressionPtr;
--- 72,75 ----
Index: CodeModelStatements.h
===================================================================
RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/CodeModelStatements.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** CodeModelStatements.h 1 Apr 2003 08:43:05 -0000 1.18
--- CodeModelStatements.h 5 Apr 2003 18:28:57 -0000 1.19
***************
*** 86,92 ****
Change getConditionChange() const;
-
- // overriden from Statement
- void accept( StatementVisitor &visitor );
protected: // overridden from CodeElement
--- 86,89 ----
***************
*** 115,119 ****
--- 112,118 ----
bool hasElseStatement() const;
+
StatementPtr getElseStatement() const;
+
void setElseStatement( const StatementPtr &statement );
***************
*** 143,149 ****
Change getIteratedStatementChange() const;
-
- // overriden from Statement
- void accept( StatementVisitor &visitor );
protected: // overridden from CodeElement
--- 142,145 ----
***************
*** 216,220 ****
CompoundStatementPtr getStatements() const;
! void setStatement( const CompoundStatementPtr &statements );
// overriden from Statement
--- 212,216 ----
CompoundStatementPtr getStatements() const;
! void setStatements( const CompoundStatementPtr &statements );
// overriden from Statement
***************
*** 229,249 ****
! class RFTA_API FlowControlStatement : public Statement
! {
! public:
! // overriden from Statement
! void accept( StatementVisitor &visitor );
! };
!
!
! class RFTA_API SwitchLabelStatement : public Statement
! {
! public:
! // overriden from Statement
! void accept( StatementVisitor &visitor );
! };
!
!
! class RFTA_API CaseStatement : public SwitchLabelStatement
{
public:
--- 225,229 ----
! class RFTA_API CaseStatement : public Statement
{
public:
***************
*** 267,271 ****
! class RFTA_API DefaultStatement : public SwitchLabelStatement
{
public:
--- 247,251 ----
! class RFTA_API DefaultStatement : public Statement
{
public:
***************
*** 275,279 ****
! class RFTA_API BreakStatement : public FlowControlStatement
{
public:
--- 255,259 ----
! class RFTA_API BreakStatement : public Statement
{
public:
***************
*** 283,287 ****
! class RFTA_API ContinueStatement : public FlowControlStatement
{
public:
--- 263,267 ----
! class RFTA_API ContinueStatement : public Statement
{
public:
***************
*** 291,295 ****
! class RFTA_API ReturnStatement : public FlowControlStatement
{
public:
--- 271,275 ----
! class RFTA_API ReturnStatement : public Statement
{
public:
***************
*** 377,381 ****
! class RFTA_API LabelHolderStatement
{
public:
--- 357,361 ----
! class RFTA_API LabelHolderStatement : public Statement
{
public:
***************
*** 398,403 ****
! class RFTA_API LabelStatement : public Statement
! , public LabelHolderStatement
{
public:
--- 378,382 ----
! class RFTA_API LabelStatement : public LabelHolderStatement
{
public:
***************
*** 409,414 ****
! class RFTA_API GotoStatement : public FlowControlStatement
! , public LabelHolderStatement
{
public:
--- 388,392 ----
! class RFTA_API GotoStatement : public LabelHolderStatement
{
public:
Index: CodeModelVisitor.h
===================================================================
RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/CodeModelVisitor.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CodeModelVisitor.h 16 Mar 2003 16:18:39 -0000 1.3
--- CodeModelVisitor.h 5 Apr 2003 18:28:57 -0000 1.4
***************
*** 18,41 ****
}
! virtual void visit( BreakStatement &statement ) =0;
! virtual void visit( CaseStatement &statement ) =0;
! virtual void visit( CompoundStatement &statement ) =0;
! virtual void visit( ConditionStatement &statement ) =0;
! virtual void visit( ContinueStatement &statement ) =0;
! virtual void visit( DefaultStatement &statement ) =0;
! virtual void visit( DeclarationStatement &statement ) =0;
! virtual void visit( DoStatement &statement ) =0;
! virtual void visit( ExpressionStatement &statement ) =0;
! virtual void visit( FlowControlStatement &statement ) =0;
! virtual void visit( ForStatement &statement ) =0;
! virtual void visit( GotoStatement &statement ) =0;
! virtual void visit( IfStatement &statement ) =0;
! virtual void visit( IterationStatement &statement ) =0;
! virtual void visit( LabelStatement &statement ) =0;
! virtual void visit( NullStatement &statement ) =0;
! virtual void visit( ReturnStatement &statement ) =0;
! virtual void visit( SwitchLabelStatement &statement ) =0;
! virtual void visit( SwitchStatement &statement ) =0;
! virtual void visit( WhileStatement &statement ) =0;
};
--- 18,37 ----
}
! virtual void visit( const BreakStatementPtr &statement ) =0;
! virtual void visit( const CaseStatementPtr &statement ) =0;
! virtual void visit( const CompoundStatementPtr &statement ) =0;
! virtual void visit( const ContinueStatementPtr &statement ) =0;
! virtual void visit( const DefaultStatementPtr &statement ) =0;
! virtual void visit( const DeclarationStatementPtr &statement ) =0;
! virtual void visit( const DoStatementPtr &statement ) =0;
! virtual void visit( const ExpressionStatementPtr &statement ) =0;
! virtual void visit( const ForStatementPtr &statement ) =0;
! virtual void visit( const GotoStatementPtr &statement ) =0;
! virtual void visit( const IfStatementPtr &statement ) =0;
! virtual void visit( const LabelStatementPtr &statement ) =0;
! virtual void visit( const NullStatementPtr &statement ) =0;
! virtual void visit( const ReturnStatementPtr &statement ) =0;
! virtual void visit( const SwitchStatementPtr &statement ) =0;
! virtual void visit( const WhileStatementPtr &statement ) =0;
};
|