Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.h

    r3be261a rbaf7fee  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Statement.h --
     7// Statement.h -- 
    88//
    99// Author           : Richard C. Bilson
     
    5757  public:
    5858        ExprStmt( std::list<Label> labels, Expression *expr );
    59         ExprStmt( const ExprStmt &other );
    6059        virtual ~ExprStmt();
    6160
     
    7473  public:
    7574        AsmStmt( std::list<Label> labels, bool voltile, ConstantExpr *instruction, std::list<Expression *> input, std::list<Expression *> output, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels );
    76         AsmStmt( const AsmStmt &other );
    7775        virtual ~AsmStmt();
    7876
     
    105103  public:
    106104        IfStmt( std::list<Label> labels, Expression *condition, Statement *thenPart, Statement *elsePart );
    107         IfStmt( const IfStmt &other );
    108105        virtual ~IfStmt();
    109106
     
    114111        Statement *get_elsePart() { return elsePart; }
    115112        void set_elsePart( Statement *newValue ) { elsePart = newValue; }
    116 
     113       
    117114        virtual IfStmt *clone() const { return new IfStmt( *this ); }
    118115        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    128125  public:
    129126        SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &branches );
    130         SwitchStmt( const SwitchStmt &other );
    131127        virtual ~SwitchStmt();
    132128
     
    150146  public:
    151147        ChooseStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &branches );
    152         ChooseStmt( const ChooseStmt &other );
    153148        virtual ~ChooseStmt();
    154149
     
    182177class CaseStmt : public Statement {
    183178  public:
    184         CaseStmt( std::list<Label> labels, Expression *conditions,
     179        CaseStmt( std::list<Label> labels, Expression *conditions, 
    185180              std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError);
    186         CaseStmt( const CaseStmt &other );
    187181        virtual ~CaseStmt();
    188182
     
    198192        std::list<Statement *> &get_statements() { return stmts; }
    199193        void set_statements( std::list<Statement *> &newValue ) { stmts = newValue; }
    200 
     194       
    201195        virtual void accept( Visitor &v ) { v.visit( this ); }
    202196        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     
    214208        WhileStmt( std::list<Label> labels, Expression *condition,
    215209               Statement *body, bool isDoWhile = false );
    216         WhileStmt( const WhileStmt &other );
    217210        virtual ~WhileStmt();
    218211
     
    223216        bool get_isDoWhile() { return isDoWhile; }
    224217        void set_isDoWhile( bool newValue ) { isDoWhile = newValue; }
    225 
     218       
    226219        virtual WhileStmt *clone() const { return new WhileStmt( *this ); }
    227220        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    238231        ForStmt( std::list<Label> labels, std::list<Statement *> initialization,
    239232             Expression *condition = 0, Expression *increment = 0, Statement *body = 0 );
    240         ForStmt( const ForStmt &other );
    241233        virtual ~ForStmt();
    242234
     
    249241        Statement *get_body() { return body; }
    250242        void set_body( Statement *newValue ) { body = newValue; }
    251 
     243       
    252244        virtual ForStmt *clone() const { return new ForStmt( *this ); }
    253245        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    267259        BranchStmt( std::list<Label> labels, Label target, Type ) throw (SemanticError);
    268260        BranchStmt( std::list<Label> labels, Expression *computedTarget, Type ) throw (SemanticError);
     261        virtual ~BranchStmt() {}
    269262
    270263        Label get_originalTarget() { return originalTarget; }
    271264        Label get_target() { return target; }
    272265        void set_target( Label newValue ) { target = newValue; }
    273 
     266       
    274267        Expression *get_computedTarget() { return computedTarget; }
    275268        void set_target( Expression * newValue ) { computedTarget = newValue; }
     
    293286  public:
    294287        ReturnStmt( std::list<Label> labels, Expression *expr, bool throwP = false );
    295         ReturnStmt( const ReturnStmt &other );
    296288        virtual ~ReturnStmt();
    297289
    298290        Expression *get_expr() { return expr; }
    299291        void set_expr( Expression *newValue ) { expr = newValue; }
    300 
     292       
    301293        virtual ReturnStmt *clone() const { return new ReturnStmt( *this ); }
    302294        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    313305        NullStmt();
    314306        NullStmt( std::list<Label> labels );
     307        virtual ~NullStmt();
    315308
    316309        virtual NullStmt *clone() const { return new NullStmt( *this ); }
     
    318311        virtual NullStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    319312        virtual void print( std::ostream &os, int indent = 0 ) const;
    320 
    321   private:
    322 };
    323 
    324 class TryStmt : public Statement {
     313       
     314  private:
     315};
     316
     317class TryStmt : public Statement { 
    325318  public:
    326319        TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<Statement *> &handlers, FinallyStmt *finallyBlock = 0 );
     
    339332        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    340333        virtual void print( std::ostream &os, int indent = 0 ) const;
    341 
     334       
    342335  private:
    343336        CompoundStmt *block;
    344337        std::list<Statement *> handlers;
    345338        FinallyStmt *finallyBlock;
    346 };
     339}; 
    347340
    348341class CatchStmt : public Statement {
    349342  public:
    350343        CatchStmt( std::list<Label> labels, Declaration *decl, Statement *body, bool isCatchRest = false );
    351         CatchStmt( const CatchStmt &other );
    352344        virtual ~CatchStmt();
    353345
     
    357349        Statement *get_body() { return body; }
    358350        void set_body( Statement *newValue ) { body = newValue; }
    359 
     351       
    360352        virtual CatchStmt *clone() const { return new CatchStmt( *this ); }
    361353        virtual void accept( Visitor &v ) { v.visit( this ); }
    362354        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    363355        virtual void print( std::ostream &os, int indent = 0 ) const;
    364 
     356       
    365357  private:
    366358        Declaration *decl;
     
    369361};
    370362
    371 class FinallyStmt : public Statement {
     363class FinallyStmt : public Statement { 
    372364  public:
    373365        FinallyStmt( std::list<Label> labels, CompoundStmt *block );
    374         FinallyStmt( const FinallyStmt &other );
    375366        virtual ~FinallyStmt();
    376367
    377368        CompoundStmt *get_block() const { return block; }
    378369        void set_block( CompoundStmt *newValue ) { block = newValue; }
    379 
     370       
    380371        virtual FinallyStmt *clone() const { return new FinallyStmt( *this ); }
    381372        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    384375  private:
    385376        CompoundStmt *block;
    386 };
     377}; 
    387378
    388379
Note: See TracChangeset for help on using the changeset viewer.