Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.h

    r4e06c1e r0f8e4ac  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 12 17:53:29 2016
    13 // Update Count     : 47
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Wed Dec 09 14:09:24 2015
     13// Update Count     : 46
    1414//
    1515
     
    149149};
    150150
     151class ChooseStmt : public Statement {
     152  public:
     153        ChooseStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &branches );
     154        ChooseStmt( const ChooseStmt &other );
     155        virtual ~ChooseStmt();
     156
     157        Expression *get_condition() { return condition; }
     158        void set_condition( Expression *newValue ) { condition = newValue; }
     159
     160        std::list<Statement *>& get_branches() { return branches; }
     161        void add_case( CaseStmt * );
     162
     163        virtual void accept( Visitor &v ) { v.visit( this ); }
     164        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     165
     166        virtual ChooseStmt *clone() const { return new ChooseStmt( *this ); }
     167        virtual void print( std::ostream &os, int indent = 0 ) const;
     168  private:
     169        Expression *condition;
     170        std::list<Statement *> branches; // should be list of CaseStmt
     171};
     172
     173class FallthruStmt : public Statement {
     174  public:
     175        FallthruStmt( std::list<Label> labels ) : Statement( labels ) { }
     176
     177        virtual void accept( Visitor &v ) { v.visit( this ); }
     178        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     179
     180        virtual FallthruStmt *clone() const { return new FallthruStmt( *this ); }
     181        virtual void print( std::ostream &os, int indent = 0 ) const;
     182};
     183
    151184class CaseStmt : public Statement {
    152185  public:
Note: See TracChangeset for help on using the changeset viewer.