Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.h

    rca78437 r294647b  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Jun 12 13:35:00 2017
    13 // Update Count     : 67
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Aug 12 13:57:46 2016
     13// Update Count     : 65
    1414//
    1515
     
    5757  private:
    5858        std::list<Statement*> kids;
    59 };
    60 
    61 class NullStmt : public CompoundStmt {
    62   public:
    63         NullStmt();
    64         NullStmt( std::list<Label> labels );
    65 
    66         virtual NullStmt *clone() const { return new NullStmt( *this ); }
    67         virtual void accept( Visitor &v ) { v.visit( this ); }
    68         virtual NullStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    69         virtual void print( std::ostream &os, int indent = 0 ) const;
    70 
    71   private:
    7259};
    7360
     
    274261class ReturnStmt : public Statement {
    275262  public:
    276         ReturnStmt( std::list<Label> labels, Expression *expr );
     263        ReturnStmt( std::list<Label> labels, Expression *expr, bool throwP = false );
    277264        ReturnStmt( const ReturnStmt &other );
    278265        virtual ~ReturnStmt();
     
    287274  private:
    288275        Expression *expr;
    289 };
    290 
    291 class ThrowStmt : public Statement {
    292   public:
    293         enum Kind { Terminate, Resume };
    294 
    295         ThrowStmt( std::list<Label> labels, Kind kind, Expression * expr, Expression * target = nullptr );
    296         ThrowStmt( const ThrowStmt &other );
    297         virtual ~ThrowStmt();
    298 
    299         Kind get_kind() { return kind; }
    300         Expression * get_expr() { return expr; }
    301         void set_expr( Expression * newExpr ) { expr = newExpr; }
    302         Expression * get_target() { return target; }
    303         void set_target( Expression * newTarget ) { target = newTarget; }
    304 
    305         virtual ThrowStmt *clone() const { return new ThrowStmt( *this ); }
    306         virtual void accept( Visitor &v ) { v.visit( this ); }
    307         virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    308         virtual void print( std::ostream &os, int indent = 0 ) const;
    309   private:
    310         Kind kind;
    311         Expression * expr;
    312         Expression * target;
     276        bool isThrow;
     277};
     278
     279
     280class NullStmt : public CompoundStmt {
     281  public:
     282        NullStmt();
     283        NullStmt( std::list<Label> labels );
     284
     285        virtual NullStmt *clone() const { return new NullStmt( *this ); }
     286        virtual void accept( Visitor &v ) { v.visit( this ); }
     287        virtual NullStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     288        virtual void print( std::ostream &os, int indent = 0 ) const;
     289
     290  private:
    313291};
    314292
     
    339317class CatchStmt : public Statement {
    340318  public:
    341         enum Kind { Terminate, Resume };
    342 
    343         CatchStmt( std::list<Label> labels, Kind kind, Declaration *decl,
    344                    Expression *cond, Statement *body );
     319        CatchStmt( std::list<Label> labels, Declaration *decl, Statement *body, bool catchAny = false );
    345320        CatchStmt( const CatchStmt &other );
    346321        virtual ~CatchStmt();
    347322
    348         Kind get_kind() { return kind; }
    349323        Declaration *get_decl() { return decl; }
    350324        void set_decl( Declaration *newValue ) { decl = newValue; }
    351         Expression *get_cond() { return cond; }
    352         void set_cond( Expression *newCond ) { cond = newCond; }
     325
    353326        Statement *get_body() { return body; }
    354327        void set_body( Statement *newValue ) { body = newValue; }
     
    360333
    361334  private:
    362         Kind kind;
    363335        Declaration *decl;
    364         Expression *cond;
    365336        Statement *body;
     337        bool catchRest;
    366338};
    367339
Note: See TracChangeset for help on using the changeset viewer.