Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.h

    r68f9c43 rcc32d83  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Sep  3 20:46:46 2017
    13 // Update Count     : 77
     12// Last Modified On : Thu Mar  8 14:53:02 2018
     13// Update Count     : 78
    1414//
    1515
     
    3838
    3939        Statement( const std::list<Label> & labels = {} );
     40        virtual ~Statement();
    4041
    4142        std::list<Label> & get_labels() { return labels; }
     
    5556        CompoundStmt( std::list<Statement *> stmts );
    5657        CompoundStmt( const CompoundStmt &other );
     58        virtual ~CompoundStmt();
    5759
    5860        std::list<Statement*>& get_kids() { return kids; }
     
    8284        ExprStmt( Expression *expr );
    8385        ExprStmt( const ExprStmt &other );
     86        virtual ~ExprStmt();
    8487
    8588        Expression *get_expr() { return expr; }
     
    102105        AsmStmt( bool voltile, Expression *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels );
    103106        AsmStmt( const AsmStmt &other );
     107        virtual ~AsmStmt();
    104108
    105109        bool get_voltile() { return voltile; }
     
    122126};
    123127
     128class DirectiveStmt : public Statement {
     129        public:
     130        std::string directive;
     131
     132        DirectiveStmt( const std::string & );
     133        virtual ~DirectiveStmt(){}
     134
     135        virtual DirectiveStmt * clone() const { return new DirectiveStmt( *this ); }
     136        virtual void accept( Visitor & v ) { v.visit( this ); }
     137        virtual Statement * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     138        virtual void print( std::ostream & os, Indenter indent = {} ) const;
     139};
     140
    124141class IfStmt : public Statement {
    125142  public:
     
    132149                        std::list<Statement *> initialization = std::list<Statement *>() );
    133150        IfStmt( const IfStmt &other );
     151        virtual ~IfStmt();
    134152
    135153        std::list<Statement *> &get_initialization() { return initialization; }
     
    154172        SwitchStmt( Expression *condition, const std::list<Statement *> &statements );
    155173        SwitchStmt( const SwitchStmt &other );
     174        virtual ~SwitchStmt();
    156175
    157176        Expression *get_condition() { return condition; }
     
    175194        CaseStmt( Expression *conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw (SemanticErrorException);
    176195        CaseStmt( const CaseStmt &other );
     196        virtual ~CaseStmt();
    177197
    178198        static CaseStmt * makeDefault( const std::list<Label> & labels = {}, std::list<Statement *> stmts = std::list<Statement *>() );
     
    205225               Statement *body, bool isDoWhile = false );
    206226        WhileStmt( const WhileStmt &other );
     227        virtual ~WhileStmt();
    207228
    208229        Expression *get_condition() { return condition; }
     
    229250             Expression *condition = 0, Expression *increment = 0, Statement *body = 0 );
    230251        ForStmt( const ForStmt &other );
     252        virtual ~ForStmt();
    231253
    232254        std::list<Statement *> &get_initialization() { return initialization; }
     
    246268class BranchStmt : public Statement {
    247269  public:
    248         enum Type { Goto = 0, Break, Continue };
     270        enum Type { Goto = 0, Break, Continue, FallThrough, FallThroughDefault };
    249271
    250272        // originalTarget kept for error messages.
     
    281303        ReturnStmt( Expression *expr );
    282304        ReturnStmt( const ReturnStmt &other );
     305        virtual ~ReturnStmt();
    283306
    284307        Expression *get_expr() { return expr; }
     
    301324        ThrowStmt( Kind kind, Expression * expr, Expression * target = nullptr );
    302325        ThrowStmt( const ThrowStmt &other );
     326        virtual ~ThrowStmt();
    303327
    304328        Kind get_kind() { return kind; }
     
    322346        TryStmt( CompoundStmt *tryBlock, std::list<CatchStmt *> &handlers, FinallyStmt *finallyBlock = 0 );
    323347        TryStmt( const TryStmt &other );
     348        virtual ~TryStmt();
    324349
    325350        CompoundStmt *get_block() const { return block; }
     
    348373                   Expression *cond, Statement *body );
    349374        CatchStmt( const CatchStmt &other );
     375        virtual ~CatchStmt();
    350376
    351377        Kind get_kind() { return kind; }
     
    369395        FinallyStmt( CompoundStmt *block );
    370396        FinallyStmt( const FinallyStmt &other );
     397        virtual ~FinallyStmt();
    371398
    372399        CompoundStmt *get_block() const { return block; }
     
    395422        WaitForStmt();
    396423        WaitForStmt( const WaitForStmt & );
     424        virtual ~WaitForStmt();
    397425
    398426        std::vector<Clause> clauses;
     
    423451        WithStmt( const std::list< Expression * > & exprs, Statement * stmt );
    424452        WithStmt( const WithStmt & other );
     453        virtual ~WithStmt();
    425454
    426455        virtual WithStmt * clone() const override { return new WithStmt( *this ); }
     
    438467        DeclStmt( Declaration *decl );
    439468        DeclStmt( const DeclStmt &other );
     469        virtual ~DeclStmt();
    440470
    441471        Declaration *get_decl() const { return decl; }
     
    459489        ImplicitCtorDtorStmt( Statement * callStmt );
    460490        ImplicitCtorDtorStmt( const ImplicitCtorDtorStmt & other );
     491        virtual ~ImplicitCtorDtorStmt();
    461492
    462493        Statement *get_callStmt() const { return callStmt; }
Note: See TracChangeset for help on using the changeset viewer.