Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.h

    r6cebfef r6180274  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jan 10 14:13:24 2020
    13 // Update Count     : 85
     12// Last Modified On : Wed Feb  2 20:15:30 2022
     13// Update Count     : 98
    1414//
    1515
     
    107107        std::list<Label> gotolabels;
    108108
    109         AsmStmt( bool voltile, Expression * instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels );
     109        AsmStmt( bool voltile, Expression * instruction, const std::list<Expression *> output, const std::list<Expression *> input, const std::list<ConstantExpr *> clobber, const std::list<Label> gotolabels );
    110110        AsmStmt( const AsmStmt & other );
    111111        virtual ~AsmStmt();
     
    148148  public:
    149149        Expression * condition;
    150         Statement * thenPart;
    151         Statement * elsePart;
     150        Statement * then;
     151        Statement * else_;
    152152        std::list<Statement *> initialization;
    153153
    154         IfStmt( Expression * condition, Statement * thenPart, Statement * elsePart,
    155                         std::list<Statement *> initialization = std::list<Statement *>() );
     154        IfStmt( Expression * condition, Statement * then, Statement * else_,
     155                        const std::list<Statement *> initialization = std::list<Statement *>() );
    156156        IfStmt( const IfStmt & other );
    157157        virtual ~IfStmt();
     
    160160        Expression * get_condition() { return condition; }
    161161        void set_condition( Expression * newValue ) { condition = newValue; }
    162         Statement * get_thenPart() { return thenPart; }
    163         void set_thenPart( Statement * newValue ) { thenPart = newValue; }
    164         Statement * get_elsePart() { return elsePart; }
    165         void set_elsePart( Statement * newValue ) { elsePart = newValue; }
     162        Statement * get_then() { return then; }
     163        void set_then( Statement * newValue ) { then = newValue; }
     164        Statement * get_else() { return else_; }
     165        void set_else( Statement * newValue ) { else_ = newValue; }
    166166
    167167        virtual IfStmt * clone() const override { return new IfStmt( *this ); }
     
    225225};
    226226
    227 class WhileStmt : public Statement {
     227class WhileDoStmt : public Statement {
    228228  public:
    229229        Expression * condition;
    230230        Statement * body;
     231        Statement * else_;
    231232        std::list<Statement *> initialization;
    232233        bool isDoWhile;
    233234
    234         WhileStmt( Expression * condition, Statement * body, std::list<Statement *> & initialization, bool isDoWhile = false );
    235         WhileStmt( const WhileStmt & other );
    236         virtual ~WhileStmt();
     235        WhileDoStmt( Expression * condition, Statement * body, const std::list<Statement *> & initialization, bool isDoWhile = false );
     236        WhileDoStmt( Expression * condition, Statement * body, Statement * else_, const std::list<Statement *> & initialization, bool isDoWhile = false );
     237        WhileDoStmt( const WhileDoStmt & other );
     238        virtual ~WhileDoStmt();
    237239
    238240        Expression * get_condition() { return condition; }
     
    243245        void set_isDoWhile( bool newValue ) { isDoWhile = newValue; }
    244246
    245         virtual WhileStmt * clone() const override { return new WhileStmt( *this ); }
     247        virtual WhileDoStmt * clone() const override { return new WhileDoStmt( *this ); }
    246248        virtual void accept( Visitor & v ) override { v.visit( this ); }
    247249        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     
    256258        Expression * increment;
    257259        Statement * body;
    258 
    259         ForStmt( std::list<Statement *> initialization, Expression * condition = nullptr, Expression * increment = nullptr, Statement * body = nullptr );
     260        Statement * else_;
     261
     262        ForStmt( const std::list<Statement *> initialization, Expression * condition = nullptr, Expression * increment = nullptr, Statement * body = nullptr, Statement * else_ = nullptr );
    260263        ForStmt( const ForStmt & other );
    261264        virtual ~ForStmt();
     
    278281class BranchStmt : public Statement {
    279282  public:
    280         enum Type { Goto = 0, Break, Continue, FallThrough, FallThroughDefault };
     283        enum Type { Goto, Break, Continue, FallThrough, FallThroughDefault, BranchStmts };
    281284
    282285        // originalTarget kept for error messages.
     
    357360        FinallyStmt * finallyBlock;
    358361
    359         TryStmt( CompoundStmt * tryBlock, std::list<CatchStmt *> & handlers, FinallyStmt * finallyBlock = nullptr );
     362        TryStmt( CompoundStmt * tryBlock, const std::list<CatchStmt *> & handlers, FinallyStmt * finallyBlock = nullptr );
    360363        TryStmt( const TryStmt & other );
    361364        virtual ~TryStmt();
     
    540543        std::list<Expression *> mutexObjs; // list of mutex objects to acquire
    541544
    542         MutexStmt( Statement * stmt, std::list<Expression *> mutexObjs );
     545        MutexStmt( Statement * stmt, const std::list<Expression *> mutexObjs );
    543546        MutexStmt( const MutexStmt & other );
    544547        virtual ~MutexStmt();
Note: See TracChangeset for help on using the changeset viewer.